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** - `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` - **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 - **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 ### Version 1.8.0 - January 23, 2015

76
src/definitions/modules/sticky.js

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

|||||||
100:0
Loading…
Cancel
Save