mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
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.
This commit is contained in:
parent
ee76058e01
commit
39a74f1ccf
@ -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,7 +81,7 @@
|
||||
if (window.location.hash.indexOf('|') === -1) {
|
||||
window.location.hash += '|default';
|
||||
}
|
||||
var path = window.location.href.replace('#','');
|
||||
var path = window.location.href.replace(/(index\.html)?#/,'');
|
||||
path = path.replace('\|','/') + '.html';
|
||||
loadPage(path);
|
||||
}
|
||||
@ -91,6 +89,7 @@
|
||||
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();
|
||||
@ -133,6 +133,8 @@
|
||||
.end()
|
||||
.end()
|
||||
;
|
||||
|
||||
resetDemos();
|
||||
}
|
||||
|
||||
function loadDemo(path) {
|
||||
@ -162,6 +164,11 @@
|
||||
notes.hide();
|
||||
}
|
||||
|
||||
function resetDemos() {
|
||||
$.datepicker.setDefaults($.datepicker.regional['']);
|
||||
$(".ui-dialog-content").remove();
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
Loading…
Reference in New Issue
Block a user