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 2bf08ee..c24fd4b 100644 --- a/frontend/delta/js/Clipperz/PM/UI/Components/Cards/Edit.js +++ b/frontend/delta/js/Clipperz/PM/UI/Components/Cards/Edit.js @@ -339,7 +339,7 @@ console.log("DROP"); //, anEvent); renderDirectLogin: function (aDirectLogin) { return React.DOM.div({'className':'cardDirectLogin', 'key':aDirectLogin['_reference']}, [ React.DOM.span({'className':'directLoginLabel'}, aDirectLogin['label']), - React.DOM.div({'className':'directLoginAction action'}, 'DIRECT LOGIN') +// React.DOM.div({'className':'directLoginAction action'}, 'DIRECT LOGIN') ]); }, diff --git a/frontend/delta/js/Clipperz/PM/UI/Components/Cards/View.js b/frontend/delta/js/Clipperz/PM/UI/Components/Cards/View.js index 3357cfc..2e3219d 100644 --- a/frontend/delta/js/Clipperz/PM/UI/Components/Cards/View.js +++ b/frontend/delta/js/Clipperz/PM/UI/Components/Cards/View.js @@ -33,6 +33,20 @@ Clipperz.PM.UI.Components.Cards.View = React.createClass({ 'loading': React.PropTypes.bool, }, + handleDirectLoginClick: function (aDirectLogin) { + var directLoginParameters; + +console.log("PROPS", this.props); + directLoginParameters = { + 'record': this.props['_reference'], + 'directLogin': aDirectLogin['_reference'], + }; + + return function (anEvent) { + MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'runDirectLogin', directLoginParameters); + }; + }, + //---------------------------------------------------------------------------- renderEmpty: function () { @@ -120,9 +134,9 @@ Clipperz.PM.UI.Components.Cards.View = React.createClass({ //............................................................................ renderDirectLogin: function (aDirectLogin) { - return React.DOM.div({'className':'cardDirectLogin'}, [ + return React.DOM.div({'className':'cardDirectLogin', 'onClick':this.handleDirectLoginClick(aDirectLogin)}, [ React.DOM.span({'className':'directLoginLabel'}, aDirectLogin['label']), - React.DOM.div({'className':'directLoginAction action'}, 'DIRECT LOGIN') +// React.DOM.div({'className':'directLoginAction action'}, 'DIRECT LOGIN') ]); }, diff --git a/frontend/delta/js/Clipperz/PM/UI/MainController.js b/frontend/delta/js/Clipperz/PM/UI/MainController.js index 714f35b..ed7397f 100644 --- a/frontend/delta/js/Clipperz/PM/UI/MainController.js +++ b/frontend/delta/js/Clipperz/PM/UI/MainController.js @@ -74,6 +74,7 @@ Clipperz.PM.UI.MainController = function() { 'goBackToMainPage', 'maskClick', 'downloadOfflineCopy', + 'runDirectLogin', ]); // MochiKit.Signal.connect(MochiKit.DOM.currentDocument(), 'onselectionchange', this, 'selectionChange_handler'); @@ -719,7 +720,7 @@ console.log("SET USER", aUser); this.moveInPage(this.currentPage(), 'mainPage'); return this.renderAccountData(); }, -/* + runDirectLogin_handler: function (someParameters) { //console.log("RUN DIRECT LOGIN", someParameters); var deferredResult; @@ -727,12 +728,12 @@ console.log("SET USER", aUser); deferredResult = new Clipperz.Async.Deferred('MainController.runDirectLogin', {trace:false}); deferredResult.addMethod(this.user(), 'getRecord', someParameters['record']); deferredResult.addMethodcaller('directLoginWithReference', someParameters['directLogin']); - deferredResult.addCallback(Clipperz.PM.UI.DirectLoginRunner.openDirectLogin); + deferredResult.addCallback(Clipperz.PM.UI.DirectLoginController.openDirectLogin); deferredResult.callback(); return deferredResult; }, - +/* shouldExitApp: function (anEvent) { //console.log("SHOULD EXIT APP"); anEvent.preventDefault();