mirror of
https://github.com/wekan/wekan.git
synced 2026-01-05 17:18:49 +01:00
isMiniScreen and showDesktopDragHandles centralized in class Utils
- a lot of same code everywhere in many files, this is against the concept "don't repeat yourself"
This commit is contained in:
parent
cbc6463019
commit
b9178cfcb6
12 changed files with 14 additions and 126 deletions
|
|
@ -191,21 +191,11 @@ BlazeComponent.extendComponent({
|
|||
});
|
||||
|
||||
this.autorun(() => {
|
||||
let showDesktopDragHandles = false;
|
||||
currentUser = Meteor.user();
|
||||
if (currentUser) {
|
||||
showDesktopDragHandles = (currentUser.profile || {})
|
||||
.showDesktopDragHandles;
|
||||
} else if (window.localStorage.getItem('showDesktopDragHandles')) {
|
||||
showDesktopDragHandles = true;
|
||||
} else {
|
||||
showDesktopDragHandles = false;
|
||||
}
|
||||
if (Utils.isMiniScreen() || showDesktopDragHandles) {
|
||||
if (Utils.isMiniScreenOrShowDesktopDragHandles()) {
|
||||
$swimlanesDom.sortable({
|
||||
handle: '.js-swimlane-header-handle',
|
||||
});
|
||||
} else if (!Utils.isMiniScreen() && !showDesktopDragHandles) {
|
||||
} else if (!Utils.isMiniScreen() && !Utils.isShowDesktopDragHandles()) {
|
||||
$swimlanesDom.sortable({
|
||||
handle: '.swimlane-header',
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue