lhcAppControllers.controller("TrItemCtrl",["$scope","$http","$location","$rootScope","$log","$window",function(e,n,a,t,s,i){this.languages=[],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.setLanguages=function(e){g.languages=void 0!==i["translationItem"+e]?i["translationItem"+e]:[],g.dialects=i.languageDialects},this.addLanguage=function(){g.languages.push({message:"",languages:[]}),setTimeout((function(){$("#tritems-tabs a:first").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),$("#tritems-tabs 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=93362f7c15f8b261c1cf648824075370.js.map
