ensures more jquery event listeners are unbound
This commit is contained in:
@@ -27,7 +27,7 @@ angular.module("umbraco.directives")
|
||||
$('a[data-toggle="tab"]').on('shown', update);
|
||||
|
||||
scope.$on('$destroy', function() {
|
||||
$('a[data-toggle="tab"]').unbind("shown", update);
|
||||
$('a[data-toggle="tab"]').off("shown", update);
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
**/
|
||||
angular.module("umbraco.directives.html")
|
||||
.directive('detectFold', function ($timeout, $log, windowResizeListener) {
|
||||
return {
|
||||
return {
|
||||
require: "^?umbTabs",
|
||||
restrict: 'A',
|
||||
link: function (scope, el, attrs) {
|
||||
|
||||
@@ -33,15 +34,14 @@ angular.module("umbraco.directives.html")
|
||||
|
||||
windowResizeListener.register(resizeCallback);
|
||||
|
||||
//TODO: Need to listen for tabs
|
||||
|
||||
$('a[data-toggle="tab"]').on('shown', function (e) {
|
||||
calculate();
|
||||
});
|
||||
|
||||
//Required for backwards compat for bootstrap tabs
|
||||
$('a[data-toggle="tab"]').on('shown', calculate);
|
||||
|
||||
//ensure to unregister
|
||||
scope.$on('$destroy', function() {
|
||||
windowResizeListener.unregister(resizeCallback);
|
||||
$('a[data-toggle="tab"]').off('shown', calculate);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -58,8 +58,14 @@ angular.module("umbraco")
|
||||
});
|
||||
});
|
||||
|
||||
$('a[data-toggle="tab"]').on('shown', function (e) {
|
||||
var tabShown = function(e) {
|
||||
google.maps.event.trigger(map, 'resize');
|
||||
};
|
||||
|
||||
$('a[data-toggle="tab"]').on('shown', tabShown);
|
||||
|
||||
$scope.$on('$destroy', function () {
|
||||
$('a[data-toggle="tab"]').off('shown', tabShown);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user