sogo/UI/WebServerResources/js/Common/ui-mobile.js
Francis Lachapelle 342441ecf8 Improve JavaScript coding style
To comitted code now passes the Airbnb pattern using jscs
2015-06-11 15:27:03 -04:00

54 lines
1.2 KiB
JavaScript

/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* JavaScript for common UI services for mobile theme */
(function() {
'use strict';
/**
* @name Dialog
* @constructor
*/
function Dialog() {
}
Dialog.alert = function(title, content) {
var alertPopup = this.$ionicPopup.alert({
title: title,
template: content
});
return alertPopup;
};
Dialog.confirm = function(title, content) {
var confirmPopup = this.$ionicPopup.confirm({
title: title,
template: content
});
return confirmPopup;
};
Dialog.prompt = function(title, content) {
var promptPopup = this.$ionicPopup.prompt({
title: title,
inputPlaceholder: content
});
return promptPopup;
};
/**
* @memberof Dialog
* @desc The factory we'll register as sgDialog in the Angular module SOGo.UIMobile
*/
Dialog.$factory = ['$ionicPopup', function($ionicPopup) {
angular.extend(Dialog, { $ionicPopup: $ionicPopup });
return Dialog; // return constructor
}];
/* Angular module instanciation */
angular.module('SOGo.UIMobile', ['ionic'])
/* Factory registration in Angular module */
.factory('sgDialog', Dialog.$factory);
})();