49 lines
1.2 KiB
JavaScript
49 lines
1.2 KiB
JavaScript
(function (context, $) {
|
|
|
|
"use strict";
|
|
|
|
context.JK = context.JK || {};
|
|
|
|
context.JK.GearSetupReminder = function (app) {
|
|
|
|
function showModal(options) {
|
|
options = options || {};
|
|
|
|
$('#gear_setup_reminder').attr('data-mode', 'gear-setup-reminder');
|
|
|
|
$('body').on('keyup', cancelModal);
|
|
|
|
$("#gear_setup_reminder a.close-modal").click(function () {
|
|
app.layout.closeDialog('gear-setup-reminder');
|
|
$('body').off('keyup', cancelModal);
|
|
return false;
|
|
})
|
|
|
|
$("#gear_setup_reminder a.setup-gear").click(function () {
|
|
app.layout.closeDialog('gear-setup-reminder');
|
|
$('body').off('keyup', cancelModal);
|
|
window.location.hash = '#/account/audio';
|
|
return false;
|
|
})
|
|
|
|
if(!app.layout.isDialogShowing('gear-setup-reminder')) {
|
|
app.layout.showDialog('gear-setup-reminder')
|
|
}
|
|
|
|
}
|
|
|
|
function cancelModal(e) {
|
|
if ((e.ctrlKey || e.metaKey) && e.keyCode == 78) {
|
|
console.log("update canceled!");
|
|
app.layout.closeDialog('gear-setup-reminder');
|
|
}
|
|
}
|
|
|
|
// Expose publics
|
|
this.show = showModal;
|
|
}
|
|
|
|
return this;
|
|
|
|
})(window, jQuery);
|