2015-07-20 22:41:24 +03:00
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
* Easy!Appointments - Open Source Web Scheduler
|
2015-10-09 00:12:59 +03:00
|
|
|
*
|
2015-07-20 22:41:24 +03:00
|
|
|
* @package EasyAppointments
|
|
|
|
* @author A.Tselegidis <alextselegidis@gmail.com>
|
2016-01-02 15:47:04 +02:00
|
|
|
* @copyright Copyright (c) 2013 - 2016, Alex Tselegidis
|
2015-10-09 00:12:59 +03:00
|
|
|
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
2015-07-20 22:41:24 +03:00
|
|
|
* @link http://easyappointments.org
|
|
|
|
* @since v1.0.0
|
|
|
|
* ---------------------------------------------------------------------------- */
|
|
|
|
|
2016-04-02 15:58:21 +03:00
|
|
|
window.BackendCustomers = window.BackendCustomers || {};
|
|
|
|
|
2013-07-05 11:39:52 +03:00
|
|
|
/**
|
2016-04-02 15:58:21 +03:00
|
|
|
* Backend Customers
|
|
|
|
*
|
2016-05-15 13:13:56 +03:00
|
|
|
* Backend Customers javasript namespace. Contains the main functionality of the backend customers
|
|
|
|
* page. If you need to use this namespace in a different page, do not bind the default event handlers
|
|
|
|
* during initialization.
|
2013-07-05 11:39:52 +03:00
|
|
|
*
|
2016-04-02 15:58:21 +03:00
|
|
|
* @module BackendCustomers
|
2013-07-05 11:39:52 +03:00
|
|
|
*/
|
2016-04-02 15:58:21 +03:00
|
|
|
(function(exports) {
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
2013-09-25 18:43:17 +03:00
|
|
|
/**
|
2015-10-09 00:12:59 +03:00
|
|
|
* The page helper contains methods that implement each record type functionality
|
2013-09-25 18:43:17 +03:00
|
|
|
* (for now there is only the CustomersHelper).
|
2015-10-09 00:12:59 +03:00
|
|
|
*
|
2016-05-15 13:13:56 +03:00
|
|
|
* @type {Object}
|
2013-09-25 18:43:17 +03:00
|
|
|
*/
|
2016-04-02 15:58:21 +03:00
|
|
|
var helper = {};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This method initializes the backend customers page. If you use this namespace
|
|
|
|
* in a different page do not use this method.
|
|
|
|
*
|
2016-05-15 13:13:56 +03:00
|
|
|
* @param {Boolean} defaultEventHandlers Optional (false), whether to bind the default
|
2016-04-02 15:58:21 +03:00
|
|
|
* event handlers or not.
|
|
|
|
*/
|
|
|
|
exports.initialize = function(defaultEventHandlers) {
|
|
|
|
if (defaultEventHandlers == undefined) defaultEventHandlers = false;
|
|
|
|
|
|
|
|
helper = new CustomersHelper();
|
|
|
|
helper.resetForm();
|
|
|
|
helper.filter('');
|
2015-10-09 00:12:59 +03:00
|
|
|
|
2013-10-10 19:50:33 +03:00
|
|
|
$('#filter-customers .results').jScrollPane();
|
|
|
|
$('#customer-appointments').jScrollPane();
|
2015-10-09 00:12:59 +03:00
|
|
|
|
2016-04-02 15:58:21 +03:00
|
|
|
if (defaultEventHandlers) {
|
|
|
|
_bindEventHandlers();
|
|
|
|
}
|
|
|
|
};
|
2015-10-09 00:12:59 +03:00
|
|
|
|
2013-07-06 03:00:04 +03:00
|
|
|
/**
|
|
|
|
* Default event handlers declaration for backend customers page.
|
|
|
|
*/
|
2016-04-02 15:58:21 +03:00
|
|
|
function _bindEventHandlers() {
|
|
|
|
helper.bindEventHandlers();
|
|
|
|
}
|
2013-09-25 18:43:17 +03:00
|
|
|
|
2016-04-02 15:58:21 +03:00
|
|
|
})(window.BackendCustomers);
|