Merge branch 'staging' into lightbox
This commit is contained in:
@@ -133,8 +133,12 @@ define([
|
||||
var PROPERTIES = ['title', 'body', 'tags', 'color'];
|
||||
var BOARD_PROPERTIES = ['title', 'color'];
|
||||
var createEditModal = function (framework, kanban) {
|
||||
if (framework.isReadOnly()) { return; }
|
||||
if (editModal) { return editModal; }
|
||||
|
||||
var dataObject = {};
|
||||
var isBoard, id;
|
||||
var offline = false;
|
||||
|
||||
var update = Util.throttle(function () {
|
||||
kanban.setBoards(kanban.options.boards);
|
||||
@@ -145,7 +149,7 @@ define([
|
||||
framework.localChange();
|
||||
update();
|
||||
};
|
||||
if (editModal) { return editModal; }
|
||||
|
||||
var conflicts, conflictContainer, titleInput, tagsDiv, colors, text;
|
||||
var content = h('div', [
|
||||
conflictContainer = h('div#cp-kanban-edit-conflicts', [
|
||||
@@ -165,7 +169,6 @@ define([
|
||||
]);
|
||||
var $tags = $(tagsDiv);
|
||||
|
||||
|
||||
var $conflict = $(conflicts);
|
||||
var $cc = $(conflictContainer);
|
||||
var conflict = {
|
||||
@@ -280,6 +283,7 @@ define([
|
||||
});
|
||||
|
||||
var commitTags = function () {
|
||||
if (offline) { return; }
|
||||
setTimeout(function () {
|
||||
dataObject.tags = Util.deduplicateString(_field.getTokens().map(function (t) {
|
||||
return t.toLowerCase();
|
||||
@@ -303,6 +307,7 @@ define([
|
||||
var $color = $(h('span.cp-kanban-palette.fa'));
|
||||
$color.addClass('cp-kanban-palette-'+(color || 'nocolor'));
|
||||
$color.click(function () {
|
||||
if (offline) { return; }
|
||||
if (color === selectedColor) { return; }
|
||||
selectedColor = color;
|
||||
$colors.find('.cp-kanban-palette').removeClass('fa-check');
|
||||
@@ -361,6 +366,17 @@ define([
|
||||
buttons: button
|
||||
});
|
||||
modal.classList.add('cp-kanban-edit-modal');
|
||||
var $modal = $(modal);
|
||||
|
||||
framework.onEditableChange(function (unlocked) {
|
||||
editor.setOption('readOnly', !unlocked);
|
||||
$title.prop('disabled', unlocked ? '' : 'disabled');
|
||||
$(_field.element).tokenfield(unlocked ? 'enable' : 'disable');
|
||||
|
||||
$modal.find('nav button.danger').prop('disabled', unlocked ? '' : 'disabled');
|
||||
offline = !unlocked;
|
||||
});
|
||||
|
||||
|
||||
var setId = function (_isBoard, _id) {
|
||||
// Reset the mdoal with a new id
|
||||
@@ -384,7 +400,7 @@ define([
|
||||
.show();
|
||||
}
|
||||
// Also reset the buttons
|
||||
$(modal).find('nav').after(UI.dialog.getButtons(button)).remove();
|
||||
$modal.find('nav').after(UI.dialog.getButtons(button)).remove();
|
||||
};
|
||||
|
||||
onRemoteChange.reg(function () {
|
||||
@@ -973,6 +989,7 @@ define([
|
||||
}
|
||||
kanban.options.readOnly = true;
|
||||
$container.addClass('cp-app-readonly');
|
||||
$container.find('.kanban-edit-item').remove();
|
||||
});
|
||||
|
||||
var getCursor = function () {
|
||||
|
||||
Reference in New Issue
Block a user