parent
8689a4fdec
commit
87397be795
5 changed files with 246 additions and 184 deletions
@ -0,0 +1,51 @@ |
|||||||
|
var EXPO = EXPO || {}; //isolated namespace
|
||||||
|
if (EXPO.advertising) { |
||||||
|
console.warn('WARNING: EXPO.advertising is already defined!'); |
||||||
|
} else { |
||||||
|
EXPO.advertising = (function () { |
||||||
|
/** |
||||||
|
* private (visible inside this module only) variables |
||||||
|
*/ |
||||||
|
/** |
||||||
|
* @type {Object} - module API interafce realization |
||||||
|
*/ |
||||||
|
var that = {}; |
||||||
|
/** |
||||||
|
* @type {Object} default setting |
||||||
|
*/ |
||||||
|
that.opt = {}; |
||||||
|
/** |
||||||
|
* dependencies.Place where you can switch on dependencies for module |
||||||
|
* @type {EXPO.common|*} - mostly used in project functions and data (block.common.js) |
||||||
|
*/ |
||||||
|
var com = EXPO.common; |
||||||
|
|
||||||
|
/** |
||||||
|
* current module general initialization |
||||||
|
* @param {Object} options - options recieved from web page view |
||||||
|
*/ |
||||||
|
that.init = function (options) { |
||||||
|
/** |
||||||
|
* default module options |
||||||
|
* @type {Object} |
||||||
|
*/ |
||||||
|
this.opt = { |
||||||
|
linkClass:"advert-modal", |
||||||
|
inputId:"id_type" |
||||||
|
|
||||||
|
}; |
||||||
|
// settings extending
|
||||||
|
$.extend(this.opt, options); |
||||||
|
// begin of initialization
|
||||||
|
var self = this, |
||||||
|
opt = this.opt; |
||||||
|
|
||||||
|
$('.'+opt.linkClass).on("mousedown", function () { |
||||||
|
$(document.getElementById(opt.inputId)).val($(this).attr("data-type-title")); |
||||||
|
}); |
||||||
|
|
||||||
|
|
||||||
|
}; |
||||||
|
return that; |
||||||
|
}()); |
||||||
|
} |
||||||
@ -0,0 +1 @@ |
|||||||
|
var EXPO=EXPO||{};EXPO.advertising?console.warn("WARNING: EXPO.advertising is already defined!"):EXPO.advertising=function(){var t={};t.opt={};EXPO.common;return t.init=function(t){this.opt={linkClass:"advert-modal",inputId:"id_type"},$.extend(this.opt,t);var n=this.opt;$("."+n.linkClass).on("mousedown",function(){$(document.getElementById(n.inputId)).val($(this).attr("data-type-title"))})},t}(); |
||||||
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue