Fixed the addition of new cards in narrow view

This commit is contained in:
Giulio Cesare Solaroli 2015-03-21 12:18:14 +01:00
parent 8453eb1f23
commit f6c76a24f0
No known key found for this signature in database
GPG Key ID: 22E34C908F02CBA2
2 changed files with 2 additions and 11 deletions

View File

@ -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) {

View File

@ -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) {