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` - **Step** - Fix incorrect bottom margin on `top attached steps`
- **Statistic** - statistic receives incorrect size when using `tiny` `large` etc inside a statistic group #3116 - **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 - **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** **Enhancements**
- **Project** - NPM depenendencies have all been updated to latest stable releases - **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 $context
.off('scrollchange' + eventNamespace, module.event.scrollchange) .off('scrollchange' + eventNamespace, module.event.scrollchange)
; ;
if(settings.type == 'fixed') {
module.resetFixed();
module.remove.placeholder();
}
$module $module
.off(eventNamespace) .off(eventNamespace)
.removeData(moduleNamespace) .removeData(moduleNamespace)
@ -389,8 +393,7 @@ $.fn.visibility = function(parameters) {
refresh: function() { refresh: function() {
module.debug('Refreshing constants (width/height)'); module.debug('Refreshing constants (width/height)');
if(settings.type == 'fixed') { if(settings.type == 'fixed') {
module.remove.fixed();
module.remove.occurred();
module.resetFixed();
} }
module.reset(); module.reset();
module.save.position(); module.save.position();
@ -400,6 +403,11 @@ $.fn.visibility = function(parameters) {
settings.onRefresh.call(element); settings.onRefresh.call(element);
}, },
resetFixed: function () {
module.remove.fixed();
module.remove.occurred();
},
reset: function() { reset: function() {
module.verbose('Reseting all cached values'); module.verbose('Reseting all cached values');
if( $.isPlainObject(module.cache) ) { if( $.isPlainObject(module.cache) ) {
@ -766,6 +774,12 @@ $.fn.visibility = function(parameters) {
; ;
settings.onUnfixed.call(element); settings.onUnfixed.call(element);
}, },
placeholder: function() {
module.debug('Removing placeholder content');
if($placeholder) {
$placeholder.remove();
}
},
occurred: function(callback) { occurred: function(callback) {
if(callback) { if(callback) {
var var

Loading…
Cancel
Save