{"size": 2137, "ext": "js", "max_stars_repo_path": "eoxserver/webclient/static/scripts/views/LayerItemView.js", "max_stars_repo_name": "constantinius/eoxserver_combined", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "eoxserver/webclient/static/scripts/views/LayerItemView.js", "max_issues_repo_name": "constantinius/eoxserver_combined", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "eoxserver/webclient/static/scripts/views/LayerItemView.js", "max_forks_repo_name": "constantinius/eoxserver_combined", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 2137.0, "max_line_length": 2137, "alphanum_fraction": 0.7182966776}
(function(){"use strict";var a=this;a.define(["backbone","communicator","globals","hbs!tmpl/BulletLayer","underscore"],function(a,b,c,d){var e=a.Marionette.ItemView.extend({tagName:"li",events:{drop:"drop",change:"onChange","click .fa-adjust":"onOpenSlider","slide .ui-slider":"onOpacityAdjust"},initialize:function(a){this.$slider=$("<div>").slider({range:"max",max:100,min:0}),this.$slider.width(100)},onShow:function(a){$(".sortable").sortable({revert:!0,delay:90,containment:".layercontrol .panel-body",axis:"y",forceHelperSize:!0,forcePlaceHolderSize:!0,placeholder:"sortable-placeholder",handle:".fa-sort",start:function(a,b){$(".ui-slider").detach(),$(".fa-adjust").toggleClass("active"),$(".fa-adjust").popover("hide")},stop:function(a,b){b.item.trigger("drop",b.item.index())}}),$(".fa-adjust").popover({trigger:"manual"})},onChange:function(a){var d=!1;this.model.get("view").isBaseLayer&&(d=!0);var e={id:this.model.get("view").id,isBaseLayer:d,visible:a.target.checked},f=c.products.find(function(a){return a.get("view").id==e.id});if(f)if(e.visible&&"WMS"==f.get("view").protocol){var g="?LAYERS="+f.get("view").id+"&TRANSPARENT=true&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&STYLES=&SRS=EPSG%3A4326&BBOX=33.75,56.25,39.375,61.875&WIDTH=256&HEIGHT=256&TIME=2014-02-19T00:00:00Z/2014-02-19T00:00:00Z";$.get(f.get("view").urls[0]+g,function(){b.mediator.trigger("map:layer:change",e)},"text")}else b.mediator.trigger("map:layer:change",e);else b.mediator.trigger("map:layer:change",e)},drop:function(a,c){b.mediator.trigger("productCollection:updateSort",{model:this.model,position:c})},onOpenSlider:function(a){this.$(".fa-adjust").toggleClass("active").hasClass("active")?(this.$(".fa-adjust").popover("show"),this.$(".popover-content").empty().append(this.$slider),this.$(".ui-slider").slider("option","value",100*this.model.get("opacity"))):(this.$slider.detach(),this.$(".fa-adjust").popover("hide"))},onOpacityAdjust:function(a,c){this.model.set("opacity",c.value/100),b.mediator.trigger("productCollection:updateOpacity",{model:this.model,value:c.value/100})}});return{LayerItemView:e}})}).call(this);