lazy load diff library in rollback dialog instead of loading it globally

This commit is contained in:
Mads Rasmussen
2018-09-25 10:12:41 +02:00
parent a47ae2e5c3
commit cfa4512f8c
2 changed files with 8 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
(function () {
"use strict";
function ContentRollbackController($scope, $timeout) {
function ContentRollbackController($scope, assetsService) {
var vm = this;
@@ -15,9 +15,10 @@
vm.variantVersions = [];
vm.diff = null;
// fake load versions
var currentLanguage = $scope.currentNode.metaData.culture;
$timeout(function(){
// Load in diff library
assetsService.loadJs('lib/jsdiff/diff.min.js', $scope).then(function () {
var currentLanguage = $scope.currentNode.metaData.culture;
vm.currentVersion = {
"id": 1,
@@ -46,7 +47,9 @@
];
vm.loading = false;
}, 200);
});
}
function rollback() {