root 2 years ago
parent
commit
d6bcb6302e
1 changed files with 15 additions and 11 deletions
  1. 15 11
      kityminder-editor/dist/index.html

+ 15 - 11
kityminder-editor/dist/index.html

@@ -79,17 +79,21 @@
 
 
 <script>
-	angular.module('kityminderDemo', ['kityminderEditor'])
-		.config(function (configProvider) {
-			configProvider.set('imageUpload', '../server/imageUpload.php');
-		})
-		.controller('MainController', function ($scope) {
-			$scope.initEditor = function (editor, minder) {
-				window.editor = editor;
-				window.minder = minder;
-				window.editor.minder.getRenderContainer().setTranslate([(window.editor.minder._lastClientSize.width - window.editor.minder._root._contentBox.width) / 2, 30]);
-			};
-		});
+	window.onload = function () {
+		angular.module('kityminderDemo', ['kityminderEditor'])
+			.config(function (configProvider) {
+				configProvider.set('imageUpload', '../server/imageUpload.php');
+			})
+			.controller('MainController', function ($scope) {
+				$scope.initEditor = function (editor, minder) {
+					window.editor = editor;
+					window.minder = minder;
+					setTimeout(function () {
+						window.editor.minder.getRenderContainer().setTranslate([(window.editor.minder._lastClientSize.width - window.editor.minder._root._contentBox.width) / 2, 30]);
+					}, 500)
+				};
+			});
+	}
 	document.domain = document.domain.split(".").slice(-2).join(".");
 </script>