summaryrefslogtreecommitdiffstats
path: root/client/components/boards
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-06-07 10:30:27 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-06-07 10:34:19 +0200
commit92dd05d06ddeb2a9434df6038c432e6b167c1c99 (patch)
treeecb93138c1dd0ab0c1fcf2682a6eae600a4bbca9 /client/components/boards
parent12919cbfc6c3fd0793624776b3afb70e3a0cdd1a (diff)
downloadwekan-92dd05d06ddeb2a9434df6038c432e6b167c1c99.tar.gz
wekan-92dd05d06ddeb2a9434df6038c432e6b167c1c99.tar.bz2
wekan-92dd05d06ddeb2a9434df6038c432e6b167c1c99.zip
Click on the page to escape the last action
This is a generalization of what we had for closing a popup by clicking outside of it. It now works for inlinedForms and detailsPane as well.
Diffstat (limited to 'client/components/boards')
-rw-r--r--client/components/boards/boardHeader.jade8
-rw-r--r--client/components/boards/router.js7
2 files changed, 5 insertions, 10 deletions
diff --git a/client/components/boards/boardHeader.jade b/client/components/boards/boardHeader.jade
index 86fbe255..258fe843 100644
--- a/client/components/boards/boardHeader.jade
+++ b/client/components/boards/boardHeader.jade
@@ -1,7 +1,7 @@
template(name="headerBoard")
- h1.header-board-menu(
- class="{{#if currentUser.isBoardMember}}is-clickable js-edit-board-title{{/if}}")
- = title
+ h1.header-board-menu
+ a(class="{{#if currentUser.isBoardAdmin}}js-edit-board-title{{else}}is-disabled{{/if}}")
+ = title
.board-header-btns.left
unless isSandstorm
@@ -12,7 +12,7 @@ template(name="headerBoard")
if showStarCounter
span {{_ 'board-nb-stars' stars}}
- a.board-header-btn.js-change-visibility(class="{{#unless currentUser.isBoardAdmin}}no-edit{{/unless}}")
+ a.board-header-btn(class="{{#if currentUser.isBoardAdmin}}js-change-visibility{{else}}is-disabled{{/if}}")
i.fa(class="{{#if isPublic}}fa-globe{{else}}fa-lock{{/if}}")
span {{_ permission}}
diff --git a/client/components/boards/router.js b/client/components/boards/router.js
index e5ccecdb..1c485225 100644
--- a/client/components/boards/router.js
+++ b/client/components/boards/router.js
@@ -43,6 +43,7 @@ Router.route('/boards/:boardId/:slug/:cardId', {
Sidebar.hide();
}
});
+ EscapeActions.executeUpTo('popup');
var params = this.params;
Session.set('currentBoard', params.boardId);
Session.set('currentCard', params.cardId);
@@ -55,9 +56,3 @@ Router.route('/boards/:boardId/:slug/:cardId', {
return Boards.findOne(this.params.boardId);
}
});
-
-// Close the card details pane by pressing escape
-EscapeActions.register('detailsPane',
- function() { Utils.goBoardId(Session.get('currentBoard')); },
- function() { return ! Session.equals('currentCard', null); }
-);