src/mobilebone.js
function(element) {
			if (!element || !element.getAttribute) return {};

			var _params = {}, _dataparams = _queryToObject(element.getAttribute("data-params") || '');

			// rules as follow:
			// data-* > data-params > options > defaults
			["title", "root", "form"].forEach(function(key) {
				_params[key] = element.getAttribute("data-" + key) || _dataparams[key] || options[key] || defaults[key];
			});

			if (typeof _params.root == "string") {
				_params.root = Mobilebone.getFunction(_params.root);
			}

			["onpagefirstinto", "callback", "fallback", "animationstart", "animationend", "preventdefault"].forEach(function(key) {
				if (Mobilebone.mergeCallback == true && typeof defaults[key] == "function") {
					// merge global callback
					var local_function_key = element.getAttribute("data-" + key) || _dataparams[key];
					if (typeof _params.root[local_function_key] == "function") {
						_params[key] = function() {
							defaults[key].apply(this, arguments);
							_params.root[local_function_key].apply(this, arguments);
						}
					} else if (typeof options[key] == "function") {
						_params[key] = function() {
							defaults[key].apply(this, arguments);
							options[key].apply(this, arguments);
						}
					} else {
						_params[key] = defaults[key];
					}
				} else {
					// replace global callback
					_params[key] = element.getAttribute("data-" + key) || _dataparams[key] || options[key] || defaults[key];
				}
			});

			return _params;
		}
function(element) {
			if (!element || !element.getAttribute) return {};

			var _params = {}, _dataparams = _queryToObject(element.getAttribute("data-params") || '');

			// rules as follow:
			// data-* > data-params > options > defaults
			["title", "root", "form"].forEach(function(key) {
				_params[key] = element.getAttribute("data-" + key) || _dataparams[key] || options[key] || defaults[key];
			});

			if (typeof _params.root == "string") {
				_params.root = Mobilebone.getFunction(_params.root);
			}

			["onpagefirstinto", "callback", "fallback", "animationstart", "animationend", "preventdefault"].forEach(function(key) {
				if (Mobilebone.mergeCallback == true && typeof defaults[key] == "function") {
					// merge global callback
					var local_function_key = element.getAttribute("data-" + key) || _dataparams[key];
					if (typeof _params.root[local_function_key] == "function") {
						_params[key] = function() {
							defaults[key].apply(this, arguments);
							_params.root[local_function_key].apply(this, arguments);
						}
					} else if (typeof options[key] == "function") {
						_params[key] = function() {
							defaults[key].apply(this, arguments);
							options[key].apply(this, arguments);
						}
					} else {
						_params[key] = defaults[key];
					}
				} else {
					// replace global callback
					_params[key] = element.getAttribute("data-" + key) || _dataparams[key] || options[key] || defaults[key];
				}
			});

			return _params;
		}
function ( element ) { if ( ! element || ! element . getAttribute ) return { } ; var _params = { } , _dataparams = _queryToObject ( element . getAttribute ( "data-params" ) || '' ) ; // rules as follow: // data-* > data-params > options > defaults [ "title" , "root" , "form" ] . forEach ( function ( key ) { _params [ key ] = element . getAttribute ( "data-" + key ) || _dataparams [ key ] || options [ key ] || defaults [ key ] ; } ) ; if ( typeof _params . root == "string" ) { _params . root = Mobilebone . getFunction ( _params . root ) ; } [ "onpagefirstinto" , "callback" , "fallback" , "animationstart" , "animationend" , "preventdefault" ] . forEach ( function ( key ) { if ( Mobilebone . mergeCallback == true && typeof defaults [ key ] == "function" ) { // merge global callback var local_function_key = element . getAttribute ( "data-" + key ) || _dataparams [ key ] ; if ( typeof _params . root [ local_function_key ] == "function" ) { _params [ key ] = function ( ) { defaults [ key ] . apply ( this , arguments ) ; _params . root [ local_function_key ] . apply ( this , arguments ) ; } } else if ( typeof options [ key ] == "function" ) { _params [ key ] = function ( ) { defaults [ key ] . apply ( this , arguments ) ; options [ key ] . apply ( this , arguments ) ; } } else { _params [ key ] = defaults [ key ] ; } } else { // replace global callback _params [ key ] = element . getAttribute ( "data-" + key ) || _dataparams [ key ] || options [ key ] || defaults [ key ] ; } } ) ; return _params ; }
defaults parameters
defaults parameters