lhcAppControllers.controller("ThemeAttrTranslatableCtrl",["$scope","$http","$location","$rootScope","$log","$window",function(e,n,a,t,i,s){this.languages=[],this.identifier=null,this.dialects=[];var g=this;this.move=function(e,n){index=g.languages.indexOf(e),newIndex=index+n,newIndex>-1&&newIndex<g.languages.length&&(removedElement=g.languages.splice(index,1)[0],g.languages.splice(newIndex,0,removedElement))},this.setDialects=function(){this.dialects=s.themeLangDialects},this.setLanguage=function(e){g.languages=void 0!==s["themeLangAttr"+e]?s["themeLangAttr"+e]:[]},this.addLanguage=function(){g.languages.push({content:"",languages:[]}),setTimeout((function(){$("#translate-tabs-"+g.identifier+" li:eq("+g.languages.length+") a").tab("show")}),250)},this.toggleSelection=function(e,n){var a=e.languages.indexOf(n);a>-1?e.languages.splice(a,1):e.languages.push(n)},this.deleteLanguage=function(e){g.languages.splice(g.languages.indexOf(e),1),$("#translate-tabs-"+g.identifier+" a:first").tab("show")},this.moveLeftField=function(e){g.move(e,-1)},this.moveRightField=function(e){g.move(e,1)},this.getLanguagesChecked=function(e){var n=[];return e.languages.forEach((function(e){2==e.length&&n.push(e)})),n.length>0?n.join(", "):e.languages.join(", ")},this.isSelectedDialect=function(e,n){void 0===e.dialect&&(e.dialect=[]);var a=!0;n.items.forEach((function(n){(-1===e.languages.indexOf(n.lang_code)||""!=n.short_code&&-1===e.languages.indexOf(n.short_code))&&(a=!1)})),e.dialect[n.lang.id]=a},this.changeSelection=function(e,n){!1===e.dialect[n.lang.id]?n.items.forEach((function(n){""!=n.short_code&&-1===e.languages.indexOf(n.short_code)&&e.languages.push(n.short_code),-1===e.languages.indexOf(n.lang_code)&&e.languages.push(n.lang_code)})):n.items.forEach((function(n){var a=null;""!=n.short_code&&(a=e.languages.indexOf(n.short_code))>-1&&e.languages.splice(a,1),(a=e.languages.indexOf(n.lang_code))>-1&&e.languages.splice(a,1)}))}}]);
//# sourceMappingURL=57a5a23f719746292b415bc941fdc378.js.map
