Merge pull request #10 from hermanschutte/master
Update use of the reserved default keyword being used as an option
This commit is contained in:
commit
4cddd808fc
|
@ -35,7 +35,7 @@ Call __pagify__ on the aforementioned div and pass in options. _The only require
|
|||
``` js
|
||||
$('#page_holder').pagify({
|
||||
pages: ['home', 'about', 'contact'],
|
||||
default: 'home' // The name of a page or null for an empty div
|
||||
'default': 'home' // The name of a page or null for an empty div
|
||||
});
|
||||
```
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
$('#page_holder').pagify({
|
||||
pages: ['about', 'usage', 'options'],
|
||||
animation: 'fadeIn',
|
||||
default: 'about',
|
||||
'default': 'about',
|
||||
cache: true
|
||||
});
|
||||
});
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
this.defaults = {
|
||||
pages: [],
|
||||
default: null,
|
||||
'default': null,
|
||||
animation: 'show',
|
||||
onChange: function (page) {},
|
||||
cache: false
|
||||
|
@ -26,7 +26,7 @@
|
|||
|
||||
// Page is selected from: passed in value, window.location, default
|
||||
if(!page) {
|
||||
page = window.location.hash.replace('#','') || self.settings.default;
|
||||
page = window.location.hash.replace('#','') || self.settings['default'];
|
||||
}
|
||||
|
||||
// Load page content from cache
|
||||
|
@ -50,7 +50,7 @@
|
|||
|
||||
// Load initial page - current hash or default page
|
||||
if(window.location.hash) self.switchPage();
|
||||
else if(self.settings.default) self.switchPage(self.settings.default);
|
||||
else if(self.settings['default']) self.switchPage(self.settings['default']);
|
||||
|
||||
};
|
||||
|
||||
|
@ -69,3 +69,5 @@
|
|||
};
|
||||
|
||||
})(jQuery);
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue