blob: a77929e6b3beeb4d1fd8b1f4e34b8fc1eab370b1 [file] [log] [blame]
window.CodiqaControls={types:{},instances:{},define:function(a,b){b._type=a;this.types[a]=b},register:function(a,b,d){var c=new this.types[a];c._type=a;c._id=b;c._opts=d;this.instances[b]=c;this.types[a].prototype._isInited||this.types[a].prototype.initType();return c},init:function(){for(var a in this.types)this.types[a].prototype.initType()},refresh:function(){for(var a in this.instances)this.instances[a].refresh&&this.instances[a].refresh()},callbackInit:function(){},getInstances:function(a){var b,
d,c=[];for(b in this.instances)d=this.instances[b],d._type===a&&c.push(d);return c}};CodiqaControls.GoogleMap=function(){};
CodiqaControls.GoogleMap.prototype.initType=function(){if(window.CodiqaControls.getInstances("googlemaps").length)if(this._isInited)window.google&&window.google.maps&&CodiqaControls.GoogleMap.prototype.callbackInit();else{var a=document.createElement("script");a.type="text/javascript";a.src="https://maps.googleapis.com/maps/api/js?sensor=true&callback=CodiqaControls.types.googlemaps.prototype.callbackInit";document.getElementsByTagName("head")[0].appendChild(a);this._isInited=!0}};
CodiqaControls.GoogleMap.prototype.callbackInit=function(){var a,b=window.CodiqaControls.getInstances("googlemaps");for(a=0;a<b.length;a++)b[a]._opts.ready(b[a])};CodiqaControls.GoogleMap.prototype.refresh=function(){this.map&&(this.el&&$(this.el).closest(".ui-page-active").length)&&(google.maps.event.trigger(this.map,"resize"),this.center&&this.map.setCenter(this.center))};window.CodiqaControls.define("googlemaps",CodiqaControls.GoogleMap);
(function(a){a.widget("mobile.tabbar",a.mobile.navbar,{_create:function(){var b=this.element.jqmData("theme")||"a";this.element.addClass("ui-footer ui-footer-fixed ui-bar-"+b);this.element.closest('[data-role="page"]').addClass("ui-page-footer-fixed");a.mobile.navbar.prototype._create.call(this)},setActive:function(a){this.element.find("a").removeClass("ui-btn-active ui-state-persist");this.element.find('a[href="'+a+'"]').addClass("ui-btn-active ui-state-persist")}});a(document).on("pagecreate create",
function(b){return a(b.target).find(":jqmData(role='tabbar')").tabbar()});a(document).on("pageshow",":jqmData(role='page')",function(b){var d=a(b.target).attr("id");b=a.mobile.activePage.find(':jqmData(role="tabbar")');b.length&&b.tabbar("setActive","#"+d);window.CodiqaControls.refresh()});window.CodiqaControls.init()})(jQuery);