diff options
author | Ca-Phun Ung <pazu2k@gmail.com> | 2009-01-02 13:17:54 +0000 |
---|---|---|
committer | Ca-Phun Ung <pazu2k@gmail.com> | 2009-01-02 13:17:54 +0000 |
commit | 39a74f1ccfd5613d023a5b7b22103f3df6aaa5b6 (patch) | |
tree | cd3552345761d480e99fddf0eaaf3a49e06235b9 | |
parent | ee76058e01121bd09524a43d2dbc97c12a2e9183 (diff) | |
download | jquery-ui-39a74f1ccfd5613d023a5b7b22103f3df6aaa5b6.tar.gz jquery-ui-39a74f1ccfd5613d023a5b7b22103f3df6aaa5b6.zip |
demos/index.html - fixed issue with browser refresh picking up wrong hash value. Added a resetDemo function to reset datepicker so it picks up default values rather than localized values.
-rw-r--r-- | demos/index.html | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/demos/index.html b/demos/index.html index 479ae140c..51c4a9fcd 100644 --- a/demos/index.html +++ b/demos/index.html @@ -72,8 +72,6 @@ jQuery(function($) { $('.left-nav a').click(function(ev) { - // reset dialog - $(".ui-dialog-content").remove(); window.location.hash = this.href.replace(/.+\/([^\/]+)\/index\.html/,'$1') + '|default'; loadPage(this.href); ev.preventDefault(); @@ -83,14 +81,15 @@ if (window.location.hash.indexOf('|') === -1) { window.location.hash += '|default'; } - var path = window.location.href.replace('#',''); - path = path.replace('\|','/') + '.html'; + var path = window.location.href.replace(/(index\.html)?#/,''); + path = path.replace('\|','/') + '.html'; loadPage(path); } - function loadPage(path) { + function loadPage(path) { var section = path.replace(/\/[^\/]+\.html/,''); var header = section.replace(/.+\/([^\/]+)/,'$1'); + $('td.normal div.normal') .empty() .append('<h4 class="demo-subheader">Functional demo:</h4>') @@ -105,7 +104,8 @@ $(this).attr('target', 'demo-frame'); $(this).click(function() { - $(".ui-dialog-content").remove(); + resetDemos(); + $(this).parents('ul').find('li').removeClass('demo-config-on'); $(this).parent().addClass('demo-config-on'); $('#demo-notes').hide(); @@ -132,7 +132,9 @@ }) .end() .end() - ; + ; + + resetDemos(); } function loadDemo(path) { @@ -161,6 +163,11 @@ $('#demo-notes').show(); notes.hide(); } + + function resetDemos() { + $.datepicker.setDefaults($.datepicker.regional['']); + $(".ui-dialog-content").remove(); + } }); </script> |