From 00e5bb61fc9f597ebc688c8a23d37842c3a2fb45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 25 Aug 2014 17:27:19 +0200 Subject: [PATCH] Trying out an alternative to modals --- src/app/controllers/annotationsEditorCtrl.js | 14 ++++++++++++++ src/app/controllers/search.js | 1 - src/app/directives/configModal.js | 6 ++++++ src/app/partials/dashboard.html | 19 ++++++++++++------- 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/src/app/controllers/annotationsEditorCtrl.js b/src/app/controllers/annotationsEditorCtrl.js index 65561643896..ce832eee1d4 100644 --- a/src/app/controllers/annotationsEditorCtrl.js +++ b/src/app/controllers/annotationsEditorCtrl.js @@ -61,4 +61,18 @@ function (angular, app, _) { }; }); + + module.controller('EditViewCtrl', function($scope) { + //$scope.editPanelSrc = 'app/partials/test.html'; + + $scope.onAppEvent('show-edit-panel', function(evt, payload) { + $scope.editPanelSrc = payload.src; + }); + + $scope.dismiss = function() { + $scope.editPanelSrc = null; + }; + + }); + }); diff --git a/src/app/controllers/search.js b/src/app/controllers/search.js index a32aa64acf0..3d11bc68750 100644 --- a/src/app/controllers/search.js +++ b/src/app/controllers/search.js @@ -173,7 +173,6 @@ function (angular, _, config, $) { "#58140C","#052B51","#511749","#3F2B5B", ]; var color = colors[Math.abs(hash % colors.length)]; - console.log("namei " + name + " color: " + color, hash % 4); element.css("background-color", color); }; diff --git a/src/app/directives/configModal.js b/src/app/directives/configModal.js index b7e579e7026..6ca19cef435 100644 --- a/src/app/directives/configModal.js +++ b/src/app/directives/configModal.js @@ -16,6 +16,12 @@ function (angular, _, $) { var id = '#' + partial.replace('.html', '').replace(/[\/|\.|:]/g, '-') + '-' + scope.$id; elem.bind('click',function() { + $timeout(function() { + scope.exitFullscreen(); + scope.emitAppEvent('show-edit-panel', {src: partial}); + }); + return; + if ($(id).length) { elem.attr('data-target', id).attr('data-toggle', 'modal'); scope.$apply(function() { scope.$broadcast('modal-opened'); }); diff --git a/src/app/partials/dashboard.html b/src/app/partials/dashboard.html index b2857205fa7..73b23ed12a4 100644 --- a/src/app/partials/dashboard.html +++ b/src/app/partials/dashboard.html @@ -8,8 +8,12 @@
+
+
+
+
+
-
@@ -100,14 +104,15 @@
-
-
-
- - ADD A ROW - +
+
+ + ADD A ROW + +
+