mirror of
https://github.com/wekan/wekan.git
synced 2025-12-21 09:50:13 +01:00
UI improvements
* Implement visibility choice on board creation;
* Rework the board header bar. Remove links to un-implemented
features;
* Implement a board star counter (visible if the board have >2 stars);
* Define a new icon (a thin cross) to close elements;
* Remove $(document).on('mouseover') event handlers that were
basically fired hundreds of times for nothing, we now define a proper
Tracker dependency to execute jquery-ui plugin initialization only
when something has changed;
* Bug fixes related to list scrolling.
This commit is contained in:
parent
42f6dc686f
commit
dcc64f44f9
51 changed files with 644 additions and 990 deletions
|
|
@ -7,10 +7,6 @@ BlazeComponent.extendComponent({
|
|||
return [Mixins.PerfectScrollbar];
|
||||
},
|
||||
|
||||
isSelected: function() {
|
||||
return Session.equals('currentCard', this.currentData()._id);
|
||||
},
|
||||
|
||||
openForm: function(options) {
|
||||
options = options || {};
|
||||
options.position = options.position || 'top';
|
||||
|
|
@ -37,11 +33,6 @@ BlazeComponent.extendComponent({
|
|||
sortIndex = Utils.getSortIndex(this.find('.js-minicard:last'), null);
|
||||
}
|
||||
|
||||
// Clear the form in-memory cache
|
||||
// var inputCacheKey = "addCard-" + this.listId;
|
||||
// InputsCache.set(inputCacheKey, '');
|
||||
|
||||
// title trim if not empty then
|
||||
if ($.trim(title)) {
|
||||
Cards.insert({
|
||||
title: title,
|
||||
|
|
@ -49,16 +40,18 @@ BlazeComponent.extendComponent({
|
|||
boardId: this.data().board()._id,
|
||||
sort: sortIndex
|
||||
}, function(err, _id) {
|
||||
// In case the filter is active we need to add the newly
|
||||
// inserted card in the list of exceptions -- cards that are
|
||||
// not filtered. Otherwise the card will disappear instantly.
|
||||
// In case the filter is active we need to add the newly inserted card
|
||||
// in the list of exceptions -- cards that are not filtered. Otherwise
|
||||
// the card will disappear instantly.
|
||||
// See https://github.com/libreboard/libreboard/issues/80
|
||||
Filter.addException(_id);
|
||||
});
|
||||
|
||||
// We keep the form opened, empty it, and scroll to it.
|
||||
textarea.val('').focus();
|
||||
Utils.Scroll(this.find('.js-minicards')).top(1000, true);
|
||||
if (position === 'bottom') {
|
||||
this.scrollToBottom();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -67,9 +60,9 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
|
||||
scrollToBottom: function() {
|
||||
var $container = $(this.firstNode());
|
||||
$container.animate({
|
||||
scrollTop: $container.height()
|
||||
var container = this.firstNode();
|
||||
$(container).animate({
|
||||
scrollTop: container.scrollHeight
|
||||
});
|
||||
},
|
||||
|
||||
|
|
@ -94,7 +87,12 @@ BlazeComponent.extendComponent({
|
|||
// Pressing Enter should submit the card
|
||||
if (evt.keyCode === 13) {
|
||||
evt.preventDefault();
|
||||
$(evt.currentTarget).parents('form:first').submit();
|
||||
var $form = $(evt.currentTarget).parents('form:first');
|
||||
// XXX For some reason $form.submit() does not work (it's probably a bug
|
||||
// of blaze-component related to the fact that the submit event is non-
|
||||
// bubbling). This is why we click on the submit button instead -- which
|
||||
// work.
|
||||
$form.find('button[type=submit]').click();
|
||||
|
||||
// Pressing Tab should open the form of the next column, and Maj+Tab go
|
||||
// in the reverse order
|
||||
|
|
@ -102,7 +100,7 @@ BlazeComponent.extendComponent({
|
|||
evt.preventDefault();
|
||||
var isReverse = evt.shiftKey;
|
||||
var list = $('#js-list-' + this.data().listId);
|
||||
var listSelector = '.js-list:not(.js-add-list)';
|
||||
var listSelector = '.js-list:not(.js-list-composer)';
|
||||
var nextList = list[isReverse ? 'prev' : 'next'](listSelector).get(0);
|
||||
// If there isn't no next list, loop back to the beginning.
|
||||
if (! nextList) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue