Commit d6f1c379 by Torkel Ödegaard

fixed text editor & scope issue

parent 6794260e
...@@ -53,7 +53,6 @@ function (angular, $, _) { ...@@ -53,7 +53,6 @@ function (angular, $, _) {
link: function($scope, elem) { link: function($scope, elem) {
var $link = $(linkTemplate); var $link = $(linkTemplate);
var $panelContainer = elem.parents(".panel-container"); var $panelContainer = elem.parents(".panel-container");
var menuTemplate = createMenuTemplate($scope);
var menuWidth = 246; var menuWidth = 246;
var menuScope = null; var menuScope = null;
var timeout = null; var timeout = null;
...@@ -106,6 +105,7 @@ function (angular, $, _) { ...@@ -106,6 +105,7 @@ function (angular, $, _) {
menuLeftPos = 0; menuLeftPos = 0;
} }
var menuTemplate = createMenuTemplate($scope);
$menu = $(menuTemplate); $menu = $(menuTemplate);
$menu.css('left', menuLeftPos); $menu.css('left', menuLeftPos);
$menu.mouseleave(function() { $menu.mouseleave(function() {
......
...@@ -20,13 +20,8 @@ function (angular, _) { ...@@ -20,13 +20,8 @@ function (angular, _) {
}, },
{ {
text: 'edit', text: 'edit',
editorLink: "app/partials/paneleditor.html", click: 'editPanel()',
condition: !$scope.panelMeta.fullscreenEdit condition: true,
},
{
text: 'edit',
click: "toggleFullscreen(true)",
condition: $scope.panelMeta.fullscreenEdit
}, },
{ {
text: 'duplicate', text: 'duplicate',
...@@ -66,6 +61,15 @@ function (angular, _) { ...@@ -66,6 +61,15 @@ function (angular, _) {
$scope.inspector = {}; $scope.inspector = {};
$scope.panelMeta.menu = _.where(menu, { condition: true }); $scope.panelMeta.menu = _.where(menu, { condition: true });
$scope.editPanel = function() {
if ($scope.panelMeta.fullscreenEdit) {
$scope.toggleFullscreen(true);
}
else {
$scope.emitAppEvent('show-dash-editor', { src: 'app/partials/paneleditor.html', scope: $scope });
}
};
$scope.editPanelJson = function() { $scope.editPanelJson = function() {
$scope.emitAppEvent('show-json-editor', { object: $scope.panel, updateHandler: $scope.replacePanel }); $scope.emitAppEvent('show-json-editor', { object: $scope.panel, updateHandler: $scope.replacePanel });
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment