diff --git a/public/app/core/directives/dash_edit_link.js b/public/app/core/directives/dash_edit_link.js index 7486d0ada18..fcf5d87487d 100644 --- a/public/app/core/directives/dash_edit_link.js +++ b/public/app/core/directives/dash_edit_link.js @@ -1,8 +1,9 @@ define([ 'jquery', + 'angular', '../core_module', ], -function ($, coreModule) { +function ($, angular, coreModule) { 'use strict'; var editViewMap = { @@ -47,6 +48,7 @@ function ($, coreModule) { elem.empty(); lastEditor = null; editorScope = null; + elem.removeClass('dash-edit-view--open'); if (editview) { var urlParams = $location.search(); @@ -74,11 +76,18 @@ function ($, coreModule) { var view = payload.src; if (view.indexOf('.html') > 0) { - view = $('
'); + view = angular.element(document.createElement('div')); + view.append($('')); } - elem.append(view); - $compile(elem.contents())(editorScope); + $compile(view)(editorScope); + + setTimeout(function() { + elem.append(view); + setTimeout(function() { + elem.addClass('dash-edit-view--open'); + }, 10); + }, 10); } scope.$watch("dashboardViewState.state.editview", function(newValue, oldValue) { diff --git a/public/app/partials/dashboard.html b/public/app/partials/dashboard.html index 95f0fb87ec8..b25ba94ff84 100644 --- a/public/app/partials/dashboard.html +++ b/public/app/partials/dashboard.html @@ -2,7 +2,7 @@