Browse Source

Visibility type: fixed now properly tears down on destroy #3548

pull/4046/head
Jack Lukic 8 years ago
parent
commit
ad8fb89ec3
2 changed files with 17 additions and 2 deletions
  1. 1
      RELEASE-NOTES.md
  2. 18
      src/definitions/behaviors/visibility.js

1
RELEASE-NOTES.md

@ -91,6 +91,7 @@
- **Step** - Fix incorrect bottom margin on `top attached steps`
- **Statistic** - statistic receives incorrect size when using `tiny` `large` etc inside a statistic group #3116
- **Table** - `striped selectable` table would not correctly show hover color on striped rows
- **Visibility** - Using `type: fixed` will now correctly remove all special classes and placeholder content on `destroy` #3548
**Enhancements**
- **Project** - NPM depenendencies have all been updated to latest stable releases

18
src/definitions/behaviors/visibility.js

@ -125,6 +125,10 @@ $.fn.visibility = function(parameters) {
$context
.off('scrollchange' + eventNamespace, module.event.scrollchange)
;
if(settings.type == 'fixed') {
module.resetFixed();
module.remove.placeholder();
}
$module
.off(eventNamespace)
.removeData(moduleNamespace)
@ -389,8 +393,7 @@ $.fn.visibility = function(parameters) {
refresh: function() {
module.debug('Refreshing constants (width/height)');
if(settings.type == 'fixed') {
module.remove.fixed();
module.remove.occurred();
module.resetFixed();
}
module.reset();
module.save.position();
@ -400,6 +403,11 @@ $.fn.visibility = function(parameters) {
settings.onRefresh.call(element);
},
resetFixed: function () {
module.remove.fixed();
module.remove.occurred();
},
reset: function() {
module.verbose('Reseting all cached values');
if( $.isPlainObject(module.cache) ) {
@ -766,6 +774,12 @@ $.fn.visibility = function(parameters) {
;
settings.onUnfixed.call(element);
},
placeholder: function() {
module.debug('Removing placeholder content');
if($placeholder) {
$placeholder.remove();
}
},
occurred: function(callback) {
if(callback) {
var

Loading…
Cancel
Save