From f6c76a24f0e5fa208a66ff95914c8b61c6a803b0 Mon Sep 17 00:00:00 2001 From: Giulio Cesare Solaroli Date: Sat, 21 Mar 2015 12:18:14 +0100 Subject: [PATCH] Fixed the addition of new cards in narrow view --- .../delta/js/Clipperz/PM/UI/Components/Cards/Edit.js | 2 +- frontend/delta/js/Clipperz/PM/UI/MainController.js | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/frontend/delta/js/Clipperz/PM/UI/Components/Cards/Edit.js b/frontend/delta/js/Clipperz/PM/UI/Components/Cards/Edit.js index 504eb0e..b699226 100644 --- a/frontend/delta/js/Clipperz/PM/UI/Components/Cards/Edit.js +++ b/frontend/delta/js/Clipperz/PM/UI/Components/Cards/Edit.js @@ -277,7 +277,7 @@ console.log("DROP"); //, anEvent); //............................................................................ cleanupTags: function (someTags) { - return MochiKit.Base.filter(Clipperz.PM.DataModel.Record.isRegularTag, someTags).sort(Clipperz.Base.caseInsensitiveCompare); + return MochiKit.Base.filter(Clipperz.PM.DataModel.Record.isRegularTag, someTags || []).sort(Clipperz.Base.caseInsensitiveCompare); }, renderTags: function (someTags) { diff --git a/frontend/delta/js/Clipperz/PM/UI/MainController.js b/frontend/delta/js/Clipperz/PM/UI/MainController.js index 7fa5dc9..7059f28 100644 --- a/frontend/delta/js/Clipperz/PM/UI/MainController.js +++ b/frontend/delta/js/Clipperz/PM/UI/MainController.js @@ -466,6 +466,7 @@ console.log("THE BROWSER IS OFFLINE"); MochiKit.Base.method(this, 'setPageProperties', 'cardDetailPage', 'features', this.features()), MochiKit.Base.method(this, 'setPageProperties', 'cardDetailPage', 'selectedCard', aValue), MochiKit.Base.method(this, 'moveInPage', this.currentPage(), 'cardDetailPage'), + function () { return aValue; }, ], {trace:false}); }, @@ -485,12 +486,9 @@ console.log("THE BROWSER IS OFFLINE"); deferredResult.addMethod(this.user(), 'getRecord', someInfo['reference']); deferredResult.addMethod(this, 'collectRecordInfo'); -//console.log("MEDIA QUERY STYLE", this.mediaQueryStyle()); deferredResult.addMethod(this, 'setPageProperties', 'mainPage', 'selectedCard'); if ((this.mediaQueryStyle() == 'narrow') && shouldShowCardDetail) { deferredResult.addMethod(this, 'showCardDetailInNarrowView'); -// deferredResult.addMethod(this, 'setPageProperties', 'cardDetailPage', 'selectedCard'); -// deferredResult.addMethod(this, 'moveInPage', this.currentPage(), 'cardDetailPage'); } MochiKit.Async.callLater(0.1, MochiKit.Base.method(deferredResult, 'callback')); @@ -836,7 +834,6 @@ console.log("THE BROWSER IS OFFLINE"); MochiKit.Async.callLater(0.5, function () { MochiKit.DOM.removeElementClass(itemToTransition, 'transition'); }) - }, //......................................................................... @@ -1304,7 +1301,6 @@ console.log("THE BROWSER IS OFFLINE"); //---------------------------------------------------------------------------- addCardClick_handler: function () { - var newRecordReference; var newRecord; return Clipperz.Async.callbacks("MainController.addCardClick_handler", [ @@ -1316,10 +1312,6 @@ console.log("THE BROWSER IS OFFLINE"); MochiKit.Base.methodcaller('addField', {'label':"", 'value':"", 'isHidden':false}), function () { return newRecord; }, MochiKit.Base.methodcaller('reference'), -// function (aValue) { -// newRecordReference = aValue; -// return newRecordReference; -// }, MochiKit.Base.method(this, 'refreshUI'), function () { return newRecord; }, MochiKit.Base.methodcaller('reference'), @@ -1396,7 +1388,6 @@ console.log("THE BROWSER IS OFFLINE"); currentPage.setProps({'allTags': aValue}); }, ], {trace:false}); - }, editCard_handler: function (anEvent) {