Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js index a0e4879..dbab41b 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js @@ -26,29 +26,49 @@ Clipperz.Base.module('Clipperz.PM.UI.Mobile.Components'); Clipperz.PM.UI.Mobile.Components.CardList = function(args) { args = args || {}; Clipperz.PM.UI.Mobile.Components.CardList.superclass.constructor.apply(this, arguments); this._cardDetail = null; - + this.render(); + return this; } //============================================================================= -Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.CardList, Clipperz.PM.UI.Common.Components.BaseComponent, { +Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.CardList, Clipperz.PM.UI.Mobile.Components.BaseComponent, { //------------------------------------------------------------------------- 'toString': function () { return "Clipperz.PM.UI.Mobile.Components.CardList component"; }, //------------------------------------------------------------------------- 'renderSelf': function () { + var headerElement; + + headerElement = MochiKit.Selector.findChildElements(this.element().parentNode, ['div[data-role=header]'])[0]; + this.append(this.element(), + {tag:'div', /*cls:'scroll',*/ id:this.getId('listBox'), children:[ + {tag:'ul', /*cls:'rounded',*/ id:this.getId('list'), children:[ + {tag:'li', html:'loading'} + ]} + ]} + ); + + this.append(headerElement, +// {tag:'a', href:"#", 'data-icon':'gear', cls:'ui-btn-right', html:"Options" } + {tag:'a', href:"#", id:this.getId('preferences'), cls:'ui-btn-right', html:"options" } + ); + + MochiKit.Signal.connect(this.getElement('preferences'), 'onclick', MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'showPreferences')); + +/* this.append(this.element(), {tag:'div', cls:'cardList', children:[ {tag:'div', cls:'toolbar', children:[ {tag:'h1', html:"clipperz"}, // {tag:'input', name:'search', type:'search', autocomplete:'off', placeholder:"search", id:this.getId('search')}, {tag:'a', href:'#', id:'settings', cls:'button', html:"*"} ]}, @@ -67,12 +87,13 @@ Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.CardList, Clipperz.PM.UI.C // MochiKit.Signal.connect(this.getElement('cardListPanel'), 'onclick', this, 'cardListClickHandler'); // MochiKit.Signal.connect('backButton', 'onclick', this, 'backButtonClickHandler'); // MochiKit.Style.hideElement('backButton'); // MochiKit.Style.hideElement(this.getElement('cardDetail')); +*/ }, 'showCards': function (someCards) { var cardListElement; if (this.isFullyRendered() == false) { this.render(); @@ -98,13 +119,13 @@ Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.CardList, Clipperz.PM.UI.C deferredResult.callback(someCards); }, 'appendCardToList': function (aCardListElement, aCardInfo) { this.append(aCardListElement, {tag:'li', cls:'cardListItem arrow', cardreference:aCardInfo['_reference'], children:[ {tag:'a', href:'#', html:aCardInfo['label'], children:[ - {tag:'small', cls:'favicon', children:[{tag:'img', cls:'favicon', src:aCardInfo['favicon']}]} +// {tag:'small', cls:'favicon', children:[{tag:'img', cls:'favicon', src:aCardInfo['favicon']}]} ]} ]}); }, 'cardSelectionHandler': function (anEvent) { var listElement; |