Rashid Khan 12 лет назад
Родитель
Сommit
40a95bedb7
2 измененных файлов с 12 добавлено и 3 удалено
  1. 11 2
      src/app/controllers/dash.js
  2. 1 1
      src/app/partials/dasheditor.html

+ 11 - 2
src/app/controllers/dash.js

@@ -68,9 +68,18 @@ function (angular, config, _) {
       return { 'min-height': row.collapse ? '5px' : row.height };
     };
 
-    $scope.edit_path = function(type) {
+    $scope.panel_path =function(type) {
       if(type) {
-        return 'app/panels/'+type.replace(".","/")+'/editor.html';
+        return 'app/panels/'+type.replace(".","/");
+      } else {
+        return false;
+      }
+    };
+
+    $scope.edit_path = function(type) {
+      var p = $scope.panel_path(type);
+      if(p) {
+        return p+'/editor.html';
       } else {
         return false;
       }

+ 1 - 1
src/app/partials/dasheditor.html

@@ -159,7 +159,7 @@
   </div>
 
   <div ng-repeat="pulldown in dashboard.current.nav" ng-controller="PulldownCtrl" ng-show="editor.index == 4+$index">
-    <ng-include ng-show="pulldown.enable" src="'./app/panels/'+pulldown.type+'/editor.html'"></ng-include>
+    <ng-include ng-show="pulldown.enable" src="edit_path(pulldown.type)"></ng-include>
     <button ng-hide="pulldown.enable" class="btn" ng-click="pulldown.enable = true">Enable the {{pulldown.type}}</button>
   </div>