Commit d6f1c379 by Torkel Ödegaard

fixed text editor & scope issue

parent 6794260e
......@@ -53,7 +53,6 @@ function (angular, $, _) {
link: function($scope, elem) {
var $link = $(linkTemplate);
var $panelContainer = elem.parents(".panel-container");
var menuTemplate = createMenuTemplate($scope);
var menuWidth = 246;
var menuScope = null;
var timeout = null;
......@@ -106,6 +105,7 @@ function (angular, $, _) {
menuLeftPos = 0;
}
var menuTemplate = createMenuTemplate($scope);
$menu = $(menuTemplate);
$menu.css('left', menuLeftPos);
$menu.mouseleave(function() {
......
......@@ -20,13 +20,8 @@ function (angular, _) {
},
{
text: 'edit',
editorLink: "app/partials/paneleditor.html",
condition: !$scope.panelMeta.fullscreenEdit
},
{
text: 'edit',
click: "toggleFullscreen(true)",
condition: $scope.panelMeta.fullscreenEdit
click: 'editPanel()',
condition: true,
},
{
text: 'duplicate',
......@@ -66,6 +61,15 @@ function (angular, _) {
$scope.inspector = {};
$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.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