Browse Source

Add observe change setting sticky

pull/1729/head
jlukic 10 years ago
parent
commit
ca323e6218
2 changed files with 41 additions and 36 deletions
  1. 1
      RELEASE-NOTES.md
  2. 76
      src/definitions/modules/sticky.js

1
RELEASE-NOTES.md

@ -7,6 +7,7 @@
- **Input** - `ui labeled input` now forces `table-cell` so that it can use `ui dropdown`
- **Input** - Fix border radius on `ui action input` with button groups, aka `ui buttons`
- **Popup** - Popup `hide all` will now use transition set in `settings.transition` when closing other popups
- **Grid** - Fix `doubling grid` setting `100% width` which may cause
### Version 1.8.0 - January 23, 2015

76
src/definitions/modules/sticky.js

@ -125,23 +125,25 @@ $.fn.sticky = function(parameters) {
var
context = $context[0]
;
if('MutationObserver' in window) {
observer = new MutationObserver(function(mutations) {
clearTimeout(module.timer);
module.timer = setTimeout(function() {
module.verbose('DOM tree modified, updating sticky menu');
module.refresh();
}, 200);
});
observer.observe(element, {
childList : true,
subtree : true
});
observer.observe(context, {
childList : true,
subtree : true
});
module.debug('Setting up mutation observer', observer);
if(settings.observeChanges) {
if('MutationObserver' in window) {
observer = new MutationObserver(function(mutations) {
clearTimeout(module.timer);
module.timer = setTimeout(function() {
module.verbose('DOM tree modified, updating sticky menu');
module.refresh();
}, 200);
});
observer.observe(element, {
childList : true,
subtree : true
});
observer.observe(context, {
childList : true,
subtree : true
});
module.debug('Setting up mutation observer', observer);
}
}
},
@ -730,25 +732,27 @@ $.fn.sticky = function(parameters) {
$.fn.sticky.settings = {
name : 'Sticky',
namespace : 'sticky',
debug : false,
verbose : false,
performance : false,
pushing : false,
context : false,
scrollContext : window,
offset : 0,
bottomOffset : 0,
onReposition : function(){},
onScroll : function(){},
onStick : function(){},
onUnstick : function(){},
onTop : function(){},
onBottom : function(){},
name : 'Sticky',
namespace : 'sticky',
debug : false,
verbose : false,
performance : false,
pushing : false,
context : false,
scrollContext : window,
offset : 0,
bottomOffset : 0,
observeChanges : false,
onReposition : function(){},
onScroll : function(){},
onStick : function(){},
onUnstick : function(){},
onTop : function(){},
onBottom : function(){},
error : {
container : 'Sticky element must be inside a relative container',

Loading…
Cancel
Save