fixed text editor & scope issue
This commit is contained in:
@@ -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 });
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user