Fix non-working Angular actions in jquery modified tables
Fix the issue by re-$compile-ing the content dynamically inserted by jQuery. Ideally we should solve it by replacing jQuery insert with Angular one. This remains a TODO for Newton release. Closes-Bug: #1514627 Co-Authored-By: Matt Borland <matt.borland@hpe.com> Change-Id: Ifbe063e9dd6c20930a1ed4fa14dddb2d0f762902
This commit is contained in:
parent
a44085d914
commit
2de6baae34
|
@ -7,7 +7,8 @@
|
||||||
'horizon.framework.util',
|
'horizon.framework.util',
|
||||||
'horizon.framework.widgets'
|
'horizon.framework.widgets'
|
||||||
])
|
])
|
||||||
.config(config);
|
.config(config)
|
||||||
|
.run(run);
|
||||||
|
|
||||||
config.$inject = [
|
config.$inject = [
|
||||||
'$injector',
|
'$injector',
|
||||||
|
@ -71,4 +72,20 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
run.$inject = ['$window', '$rootScope'];
|
||||||
|
|
||||||
|
function run($window, $rootScope) {
|
||||||
|
$window.recompileAngularContent = recompileAngularContent;
|
||||||
|
|
||||||
|
function recompileAngularContent() {
|
||||||
|
var body = angular.element('body');
|
||||||
|
|
||||||
|
function explicit($compile) {
|
||||||
|
$compile(body)($rootScope);
|
||||||
|
}
|
||||||
|
explicit.$inject = ['$compile'];
|
||||||
|
body.injector().invoke(explicit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -98,6 +98,13 @@ horizon.datatables = {
|
||||||
$new_row.find('.table-row-multi-select').prop('checked', true);
|
$new_row.find('.table-row-multi-select').prop('checked', true);
|
||||||
}
|
}
|
||||||
$row.replaceWith($new_row);
|
$row.replaceWith($new_row);
|
||||||
|
|
||||||
|
// TODO(matt-borland, tsufiev): ideally we should solve the
|
||||||
|
// problem with not-working angular actions in a content added
|
||||||
|
// by jQuery via replacing jQuery insert with Angular insert.
|
||||||
|
// Should address this in Newton release
|
||||||
|
recompileAngularContent();
|
||||||
|
|
||||||
// Reset tablesorter's data cache.
|
// Reset tablesorter's data cache.
|
||||||
$table.trigger("update");
|
$table.trigger("update");
|
||||||
// Reset decay constant.
|
// Reset decay constant.
|
||||||
|
|
Loading…
Reference in New Issue