|
|
@@ -13,7 +13,6 @@ function (angular) {
|
|
|
|
|
|
'<div class="row-fluid panel-extra"><div class="panel-extra-container">' +
|
|
|
|
|
|
-
|
|
|
'<span class="extra row-button" ng-show="panel.editable != false">' +
|
|
|
'<span ng-click="remove_panel_from_row(row,panel)" class="pointer">'+
|
|
|
'<i class="icon-remove pointer" bs-tooltip="\'Remove\'"></i></span>'+
|
|
|
@@ -61,16 +60,22 @@ function (angular) {
|
|
|
link: function($scope, elem, attr) {
|
|
|
// once we have the template, scan it for controllers and
|
|
|
// load the module.js if we have any
|
|
|
+ var newScope = $scope.$new();
|
|
|
|
|
|
// compile the module and uncloack. We're done
|
|
|
function loadModule($module) {
|
|
|
$module.appendTo(elem);
|
|
|
elem.wrap(container);
|
|
|
/* jshint indent:false */
|
|
|
- $compile(elem.contents())($scope);
|
|
|
+ $compile(elem.contents())(newScope);
|
|
|
elem.removeClass("ng-cloak");
|
|
|
}
|
|
|
|
|
|
+ newScope.$on('$destroy',function(){
|
|
|
+ elem.unbind();
|
|
|
+ elem.remove();
|
|
|
+ });
|
|
|
+
|
|
|
$scope.$watch(attr.type, function (name) {
|
|
|
elem.addClass("ng-cloak");
|
|
|
// load the panels module file, then render it in the dom.
|