55 lines
1.4 KiB
JavaScript
55 lines
1.4 KiB
JavaScript
(function(context,$) {
|
|
|
|
"use strict";
|
|
context.JK = context.JK || {};
|
|
context.JK.WhatsNextDialog = function(app) {
|
|
var logger = context.JK.logger;
|
|
var rest = context.JK.Rest();
|
|
var invitationDialog = null;
|
|
|
|
|
|
function registerEvents() {
|
|
|
|
$('#whatsnext-dialog a.facebook-invite').on('click', function(e) {
|
|
alert("This feature not yet implemented");
|
|
});
|
|
|
|
$('#whatsnext-dialog a.google-invite').on('click', function(e) {
|
|
invitationDialog.showGoogleDialog();
|
|
});
|
|
|
|
$('#whatsnext-dialog a.email-invite').on('click', function(e) {
|
|
invitationDialog.showEmailDialog();
|
|
});
|
|
}
|
|
function beforeShow() {
|
|
}
|
|
|
|
function beforeHide() {
|
|
var $dontShowWhatsNext = $('#show_whats_next');
|
|
|
|
if($dontShowWhatsNext.is(':checked')) {
|
|
rest.updateUser( {show_whats_next:false})
|
|
}
|
|
|
|
}
|
|
|
|
function initialize(invitationDialogInstance) {
|
|
var dialogBindings = {
|
|
'beforeShow' : beforeShow,
|
|
'beforeHide': beforeHide
|
|
};
|
|
|
|
app.bindDialog('whatsNext', dialogBindings);
|
|
|
|
registerEvents();
|
|
|
|
invitationDialog = invitationDialogInstance;
|
|
};
|
|
|
|
|
|
this.initialize = initialize;
|
|
}
|
|
|
|
return this;
|
|
})(window,jQuery); |