diff --git a/README.md b/README.md index bb3c2e0..f6fe563 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ $ git clone https://github.com/angularify/angular-semantic-ui.git Than go to the `angular-semantic-ui` directory and install dependencies: ``` -$ npm install && bower install +$ npm install ``` Then execute: diff --git a/dist/angular-semantic-ui.js b/dist/angular-semantic-ui.js index e20d678..4c7df68 100644 --- a/dist/angular-semantic-ui.js +++ b/dist/angular-semantic-ui.js @@ -275,7 +275,7 @@ angular.module('angularify.semantic.dimmer', []) // scope.$watch('model', function(val){ if (val == false || val == undefined) - return; + scope.dimmer_class = 'ui page dimmer'; else scope.dimmer_class = 'ui page active dimmer'; }); diff --git a/dist/angular-semantic-ui.min.js b/dist/angular-semantic-ui.min.js index 68b72f3..52ce317 100644 --- a/dist/angular-semantic-ui.min.js +++ b/dist/angular-semantic-ui.min.js @@ -1 +1 @@ -function sidebar(){return{restrict:"E",replace:!0,transclude:!0,template:'',scope:{buttonClass:"@"},link:function(a,b,c){b.sidebar("attach events",a.buttonClass,"show")}}}function sidebarItemGroup(){return{restrict:"E",replace:!0,transclude:!0,template:'
{{ title }}
',scope:{title:"@"}}}function sidebarItem(){return{restrict:"E",replace:!0,transclude:!0,template:'
'}}function sidebarLink(){return{restrict:"E",replace:!0,template:'{{ title }}',scope:{title:"@",icon:"@",href:"@"}}}function wizardButtonDirective(a){angular.module("angularify.semantic.wizard").directive(a,function(){return{restrict:"A",replace:!1,require:"^wizard",link:function(b,c,d,e){b.noMargin={margin:0},c.on("click",function(c){c.preventDefault(),b.$apply(function(){b.$eval(d[a]),e[a.replace("wz","").toLowerCase()]()})})}}})}angular.module("angularify.semantic",["angularify.semantic.accordion","angularify.semantic.checkbox","angularify.semantic.dimmer","angularify.semantic.dropdown","angularify.semantic.modal","angularify.semantic.popup","angularify.semantic.rating","angularify.semantic.sidebar","angularify.semantic.wizard"]),angular.module("angularify.semantic.accordion",[]).controller("AccordionController",["$scope",function(a){a.accordions=[],this.add_accordion=function(b){a.accordions.push(b);var c=this;return b.$on("$destroy",function(a){c.remove_accordion(b)}),a.accordions},this.closeAll=function(b){var c=0,d=!1,e=a.accordions.indexOf(b);for(c in a.accordions)a.accordions[c].close&&(d=!0);if(1==d){for(c in a.accordions)c!==e&&(a.accordions[c].active=!1);return!0}return!1},this.remove_accordion=function(b){var c=a.accordions.indexOf(b);-1!==c&&a.accordions.splice(c,1)},this.is_close_all=function(){var b=0;for(b in a.accordions)if("true"==a.accordions[b].close)return!0;return!1}}]).directive("accordion",function(){return{restrict:"E",replace:!0,transclude:!0,controller:"AccordionController",scope:{close:"@"},template:'
',link:function(a,b,c,d){"undefined"!=typeof c.styled&&b.addClass("styled"),d.add_accordion(a)}}}).directive("accordionGroup",function(){return{restrict:"E",replace:!0,transclude:!0,scope:{title:"@",open:"@"},require:"^accordion",template:'
{{ title }}
',link:function(a,b,c,d){a.active="true"===c.open,d.add_accordion(a),a.click_on_accordion_tab=function(){d.closeAll(a),a.active=!a.active,b.children().last().slideToggle()}}}}),angular.module("angularify.semantic.checkbox",[]).directive("checkbox",function(){return{restrict:"E",replace:!0,transclude:!0,scope:{type:"@",size:"@",checked:"@",disabled:"@",model:"=ngModel"},template:'
',link:function(a,b,c,d){"standard"==a.type||void 0===a.type?(a.type="standard",a.checkbox_class="ui checkbox"):"slider"==a.type?(a.type="slider",a.checkbox_class="ui slider checkbox"):"toggle"==a.type?(a.type="toggle",a.checkbox_class="ui toggle checkbox"):(a.type="standard",a.checkbox_class="ui checkbox"),"large"==a.size?a.checkbox_class=a.checkbox_class+" large":"huge"==a.size&&(a.checkbox_class=a.checkbox_class+" huge"),"false"==a.checked||void 0===a.checked?a.checked=!1:(a.checked=!0,b.children()[0].setAttribute("checked","")),"disabled"==a.disabled&&(a.checkbox_class+=" disabled"),b.bind("click",function(){a.$apply(function(){void 0===a.disabled&&(a.checked===!0?(a.checked=!0,a.model=!1,b.children()[0].removeAttribute("checked")):(a.checked=!0,a.model=!0,b.children()[0].setAttribute("checked","true")))})}),a.$watch("model",function(c){void 0!==c&&(c===!0?(a.checked=!0,b.children()[0].setAttribute("checked","true")):(a.checked=!1,b.children()[0].removeAttribute("checked")))})}}}),angular.module("angularify.semantic.dimmer",[]).directive("pageDimmer",function(){return{restrict:"E",replace:!0,transclude:!0,scope:{show:"=?",model:"=ngModel"},template:'
',link:function(a,b,c,d){1==a.show?a.dimmer_class="ui page active dimmer":(a.show=!1,a.dimmer_class="ui page disable dimmer"),a.click_on_dimmer=function(){a.model=!1,a.dimmer_class="ui page dimmer"},a.$watch("model",function(b){0!=b&&void 0!=b&&(a.dimmer_class="ui page active dimmer")})}}}),angular.module("angularify.semantic.dropdown",[]).controller("DropDownController",["$scope",function(a){a.options=[],this.add_option=function(b,c){a.options.push({title:b,value:c}),c==a.model&&this.update_title(c)},this.remove_option=function(b,c){for(var d in a.options)if(a.options[d].value==c&&a.options[d].title==b){a.options.splice(d,1);break}},this.update_model=function(b,c){a.model!==c&&(a.model=c)},this.update_title=function(b){var c=!1;for(var d in a.options)a.options[d].value==b&&(a.title=a.options[d].title,c=!0);c?a.text_class="text":(a.title=a.original_title,a.text_class="default text")}}]).directive("dropdown",function(){return{restrict:"E",replace:!0,transclude:!0,controller:"DropDownController",scope:{title:"@",open:"@",model:"=ngModel"},template:'',link:function(a,b,c,d){a.dropdown_class="ui selection dropdown",a.menu_class="menu transition hidden",a.text_class="default text",a.original_title=a.title,"true"===a.open?(a.is_open=!0,a.dropdown_class=a.dropdown_class+" active visible",a.menu_class=a.menu_class+" visible"):a.is_open=!1,a.element=b,a.$watch("model",function(a){d.update_title(a)}),b.bind("click",function(){a.$apply(a.is_open===!1?function(){a.dropdown_class="ui selection dropdown active visible",a.menu_class="menu transition visible"}:function(){a.dropdown_class="ui selection dropdown",a.menu_class="menu transition hidden"}),a.is_open=!a.is_open})}}}).directive("dropdownGroup",function(){return{restrict:"AE",replace:!0,transclude:!0,require:"^dropdown",scope:{title:"=title",value:"=value"},template:'
{{ item_title }}
',link:function(a,b,c,d){void 0===a.title?a.item_title=c.title||b.children()[0].innerHTML:a.item_title=a.title,void 0===a.value?a.item_value=c.value||a.item_title:a.item_value=a.value,d.add_option(a.item_title,a.item_value),b.bind("click",function(){d.update_model(a.item_title,a.item_value)}),a.$on("$destroy",function(){d.remove_option(a.item_title,a.item_value)})}}}),angular.module("angularify.semantic.modal",[]).directive("modal",function(){return{restrict:"E",replace:!0,transclude:!0,require:"ngModel",template:'',link:function(a,b,c,d){b.modal({onHide:function(){d.$setViewValue(!1)}}),a.$watch(function(){return d.$modelValue},function(a){b.modal(a?"show":"hide")})}}}),angular.module("angularify.semantic.popup",[]).directive("popup",function($document){return{restrict:"A",scope:{popup:"@"},link:function(scope,element,attrs){function getPos(a){for(var b=0,c=0;;){if(b+=a.offsetLeft,c+=a.offsetTop,null===a.offsetParent)break;a=a.offsetParent}return[b,c]}var class_name="",popup_meta_data=eval("("+scope.popup+")"),title=popup_meta_data.title;void 0==title&&(title="");var content=popup_meta_data.content;void 0==content&&(content="");var position=popup_meta_data.position;void 0==position&&(position="top");var size=popup_meta_data.size;void 0==size&&(size="small"),class_name="left"==position?"ui popup left center transition visible "+size:"right"==position?"ui popup right center transition visible "+size:"bottom"==position?"ui popup bottom center transition visible "+size:"ui popup top center transition visible "+size;var current_element_position_top_left=getPos(element[0]),current_element_height=element[0].offsetHeight,current_element_width=element[0].offsetWidth;NodeList.prototype.remove=HTMLCollection.prototype.remove=function(){for(var a=0,b=this.length;b>a;a++)this[a]&&this[a].parentElement&&this[a].parentElement.removeChild(this[a])},element.bind("mouseenter",function(){var a='
'+title+'
'+content+"
";angular.element(element[0]).append(a);var b=document.getElementById("my-popup").clientHeight,c=document.getElementById("my-popup").clientWidth;"left"==position?(document.getElementById("my-popup").style.top=current_element_position_top_left[1]+current_element_height/2-b/2+"px",document.getElementById("my-popup").style.right="auto",document.getElementById("my-popup").style.left=current_element_position_top_left[0]-c-10+"px",document.getElementById("my-popup").style.bottom="auto",document.getElementById("my-popup").style.display="inline-block"):"right"==position?(document.getElementById("my-popup").style.top=current_element_position_top_left[1]+current_element_height/2-b/2+"px",document.getElementById("my-popup").style.right="auto",document.getElementById("my-popup").style.left=current_element_position_top_left[0]+current_element_width+"px",document.getElementById("my-popup").style.bottom="auto",document.getElementById("my-popup").style.display="inline-block"):"bottom"==position?(document.getElementById("my-popup").style.top=current_element_position_top_left[1]+current_element_height+"px",document.getElementById("my-popup").style.left=current_element_position_top_left[0]+current_element_width/2-c/2+15+"px",document.getElementById("my-popup").style.right="auto",document.getElementById("my-popup").style.bottom="auto",document.getElementById("my-popup").style.display="inline-block"):(document.getElementById("my-popup").style.top=current_element_position_top_left[1]-b-10+"px",document.getElementById("my-popup").style.left=current_element_position_top_left[0]+current_element_width/2-c/2+18+"px",document.getElementById("my-popup").style.right="auto",document.getElementById("my-popup").style.bottom="auto",document.getElementById("my-popup").style.display="inline-block")}),element.bind("mouseleave",function(){document.getElementsByClassName("ui popup bottom center transition visible").remove(),null!==document.getElementById("my-popup")&&document.getElementById("my-popup").remove()})}}}),angular.module("angularify.semantic.sidebar",[]).directive("sidebar",sidebar).directive("sidebarLink",sidebarLink).directive("sidebarItem",sidebarItem).directive("sidebarItemGroup",sidebarItemGroup),angular.module("angularify.semantic.rating",[]).directive("rating",function(){return{restrict:"E",replace:!0,transclude:!0,scope:{id:"@",size:"@",type:"@",model:"=ngModel"},template:'
',link:function(a,b,c){void 0==a.model&&(a.model=0),a.model<1&&a.model>5&&(a.model=0);var d=!1;void 0==a.type&&(a.type="star"),void 0==a.size?a.div_class="ui rating "+a.type:"small"==a.size?a.div_class="ui small "+a.type+" rating":"large"==a.size?a.div_class="ui large "+a.type+" rating":"huge"==a.size&&(a.div_class="ui huge "+a.type+" rating"),a.icon_class="icon",a.mouse_enter=function(b){if(1!=d){var c=1;for(c;b>=c;c++)document.getElementById(a.id+c).className="icon active"}},a.mouse_leave=function(b){if(1!=d){var c=1;for(c;5>=c;c++)document.getElementById(a.id+c).className="icon"}},a.click=function(b,c){var e=1;for(e;b>=e;e++)document.getElementById(a.id+e).className="icon active";0!==b&&(d=!0)},a.$watch("model",function(b){a.click(b)})}}}),angular.module("angularify.semantic.wizard",[]).controller("WizardController",["$scope",function(a){function b(){a.steps.forEach(function(a){a.selected=!1}),a.selectedStep=null}a.steps=[],a.currentStep=null,a.stepsLength="",a.$watch("currentStep",function(b){if(b){var c=a.selectedStep.title;a.selectedStep&&c!==a.currentStep&&a.goTo(a.steps.filter(function(b){return b.title==-a.currentStep})[0])}}),a.$watch("[editMode, steps.length]",function(){var b=a.editMode;void 0!==b&&null!==b&&b&&a.steps.forEach(function(a){a.completed=!0})},!0),this.addStep=function(b){a.steps.push(b),1===a.steps.length&&a.goTo(a.steps[0])},a.goTo=function(c){b(),a.selectedStep=c,void 0!==a.currentStep&&(a.currentStep=c.title),c.selected=!0,a.$emit("wizard:stepChanged",{step:c,index:a.steps.indexOf(c)})},this.next=function(){var b=a.steps.indexOf(a.selectedStep);a.selectedStep.completed=!0,b===a.steps.length-1?this.finish():a.goTo(a.steps[b+1])},this.goTo=function(b){var c;c=angular.isNumber(b)?a.steps[b]:a.steps.filter(function(a){return a.title===a})[0],a.goTo(c)},this.finish=function(){a.onFinish&&(a.selectedStep.completed=!0,a.onFinish())},this.cancel=this.previous=function(){var b=a.steps.indexOf(a.selectedStep);if(0===b)throw new Error("Cant go back. Its already in step 0");a.goTo(a.steps[b-1])},a.getStatus=function(a){var b=[];return a.selected&&b.push("active"),a.selected||a.completed||b.push("disabled"),a.completed&&b.push("completed"),b}}]).directive("wizard",function(){return{restrict:"EA",replace:!0,transclude:!0,scope:{fullwidth:"@",currentStep:"=?",onFinish:"&",editMode:"=",name:"@"},controller:"WizardController",template:'
{{step.title}}
',link:function(a,b,c,d){if("true"===a.fullwidth){var e={0:"",1:"one",2:"two",3:"three",4:"four",5:"five",6:"six",7:"seven",8:"eight",9:"nine",10:"ten"};a.stepsLength=e[a.steps.length]}}}}).directive("wizardPane",function(){return{restrict:"EA",replace:!0,transclude:!0,require:"^wizard",controller:"WizardController",scope:{title:"@"},template:'
',link:function(a,b,c,d){d.addStep(a)}}}),wizardButtonDirective("wzNext"),wizardButtonDirective("wzPrevious"),wizardButtonDirective("wzFinish"),wizardButtonDirective("wzCancel"); \ No newline at end of file +function sidebar(){return{restrict:"E",replace:!0,transclude:!0,template:'',scope:{buttonClass:"@"},link:function(a,b,c){b.sidebar("attach events",a.buttonClass,"show")}}}function sidebarItemGroup(){return{restrict:"E",replace:!0,transclude:!0,template:'
{{ title }}
',scope:{title:"@"}}}function sidebarItem(){return{restrict:"E",replace:!0,transclude:!0,template:'
'}}function sidebarLink(){return{restrict:"E",replace:!0,template:'{{ title }}',scope:{title:"@",icon:"@",href:"@"}}}function wizardButtonDirective(a){angular.module("angularify.semantic.wizard").directive(a,function(){return{restrict:"A",replace:!1,require:"^wizard",link:function(b,c,d,e){b.noMargin={margin:0},c.on("click",function(c){c.preventDefault(),b.$apply(function(){b.$eval(d[a]),e[a.replace("wz","").toLowerCase()]()})})}}})}angular.module("angularify.semantic",["angularify.semantic.accordion","angularify.semantic.checkbox","angularify.semantic.dimmer","angularify.semantic.dropdown","angularify.semantic.modal","angularify.semantic.popup","angularify.semantic.rating","angularify.semantic.sidebar","angularify.semantic.wizard"]),angular.module("angularify.semantic.accordion",[]).controller("AccordionController",["$scope",function(a){a.accordions=[],this.add_accordion=function(b){a.accordions.push(b);var c=this;return b.$on("$destroy",function(a){c.remove_accordion(b)}),a.accordions},this.closeAll=function(b){var c=0,d=!1,e=a.accordions.indexOf(b);for(c in a.accordions)a.accordions[c].close&&(d=!0);if(1==d){for(c in a.accordions)c!==e&&(a.accordions[c].active=!1);return!0}return!1},this.remove_accordion=function(b){var c=a.accordions.indexOf(b);-1!==c&&a.accordions.splice(c,1)},this.is_close_all=function(){var b=0;for(b in a.accordions)if("true"==a.accordions[b].close)return!0;return!1}}]).directive("accordion",function(){return{restrict:"E",replace:!0,transclude:!0,controller:"AccordionController",scope:{close:"@"},template:'
',link:function(a,b,c,d){"undefined"!=typeof c.styled&&b.addClass("styled"),d.add_accordion(a)}}}).directive("accordionGroup",function(){return{restrict:"E",replace:!0,transclude:!0,scope:{title:"@",open:"@"},require:"^accordion",template:'
{{ title }}
',link:function(a,b,c,d){a.active="true"===c.open,d.add_accordion(a),a.click_on_accordion_tab=function(){d.closeAll(a),a.active=!a.active,b.children().last().slideToggle()}}}}),angular.module("angularify.semantic.checkbox",[]).directive("checkbox",function(){return{restrict:"E",replace:!0,transclude:!0,scope:{type:"@",size:"@",checked:"@",disabled:"@",model:"=ngModel"},template:'
',link:function(a,b,c,d){"standard"==a.type||void 0===a.type?(a.type="standard",a.checkbox_class="ui checkbox"):"slider"==a.type?(a.type="slider",a.checkbox_class="ui slider checkbox"):"toggle"==a.type?(a.type="toggle",a.checkbox_class="ui toggle checkbox"):(a.type="standard",a.checkbox_class="ui checkbox"),"large"==a.size?a.checkbox_class=a.checkbox_class+" large":"huge"==a.size&&(a.checkbox_class=a.checkbox_class+" huge"),"false"==a.checked||void 0===a.checked?a.checked=!1:(a.checked=!0,b.children()[0].setAttribute("checked","")),"disabled"==a.disabled&&(a.checkbox_class+=" disabled"),b.bind("click",function(){a.$apply(function(){void 0===a.disabled&&(a.checked===!0?(a.checked=!0,a.model=!1,b.children()[0].removeAttribute("checked")):(a.checked=!0,a.model=!0,b.children()[0].setAttribute("checked","true")))})}),a.$watch("model",function(c){void 0!==c&&(c===!0?(a.checked=!0,b.children()[0].setAttribute("checked","true")):(a.checked=!1,b.children()[0].removeAttribute("checked")))})}}}),angular.module("angularify.semantic.dimmer",[]).directive("pageDimmer",function(){return{restrict:"E",replace:!0,transclude:!0,scope:{show:"=?",model:"=ngModel"},template:'
',link:function(a,b,c,d){1==a.show?a.dimmer_class="ui page active dimmer":(a.show=!1,a.dimmer_class="ui page disable dimmer"),a.click_on_dimmer=function(){a.model=!1,a.dimmer_class="ui page dimmer"},a.$watch("model",function(b){0==b||void 0==b?a.dimmer_class="ui page dimmer":a.dimmer_class="ui page active dimmer"})}}}),angular.module("angularify.semantic.dropdown",[]).controller("DropDownController",["$scope",function(a){a.options=[],this.add_option=function(b,c){a.options.push({title:b,value:c}),c==a.model&&this.update_title(c)},this.remove_option=function(b,c){for(var d in a.options)if(a.options[d].value==c&&a.options[d].title==b){a.options.splice(d,1);break}},this.update_model=function(b,c){a.model!==c&&(a.model=c)},this.update_title=function(b){var c=!1;for(var d in a.options)a.options[d].value==b&&(a.title=a.options[d].title,c=!0);c?a.text_class="text":(a.title=a.original_title,a.text_class="default text")}}]).directive("dropdown",function(){return{restrict:"E",replace:!0,transclude:!0,controller:"DropDownController",scope:{title:"@",open:"@",model:"=ngModel"},template:'',link:function(a,b,c,d){a.dropdown_class="ui selection dropdown",a.menu_class="menu transition hidden",a.text_class="default text",a.original_title=a.title,"true"===a.open?(a.is_open=!0,a.dropdown_class=a.dropdown_class+" active visible",a.menu_class=a.menu_class+" visible"):a.is_open=!1,a.element=b,a.$watch("model",function(a){d.update_title(a)}),b.bind("click",function(){a.is_open===!1?a.$apply(function(){a.dropdown_class="ui selection dropdown active visible",a.menu_class="menu transition visible"}):a.$apply(function(){a.dropdown_class="ui selection dropdown",a.menu_class="menu transition hidden"}),a.is_open=!a.is_open})}}}).directive("dropdownGroup",function(){return{restrict:"AE",replace:!0,transclude:!0,require:"^dropdown",scope:{title:"=title",value:"=value"},template:'
{{ item_title }}
',link:function(a,b,c,d){void 0===a.title?a.item_title=c.title||b.children()[0].innerHTML:a.item_title=a.title,void 0===a.value?a.item_value=c.value||a.item_title:a.item_value=a.value,d.add_option(a.item_title,a.item_value),b.bind("click",function(){d.update_model(a.item_title,a.item_value)}),a.$on("$destroy",function(){d.remove_option(a.item_title,a.item_value)})}}}),angular.module("angularify.semantic.modal",[]).directive("modal",function(){return{restrict:"E",replace:!0,transclude:!0,require:"ngModel",template:'',link:function(a,b,c,d){b.modal({onHide:function(){d.$setViewValue(!1)}}),a.$watch(function(){return d.$modelValue},function(a){b.modal(a?"show":"hide")})}}}),angular.module("angularify.semantic.popup",[]).directive("popup",function($document){return{restrict:"A",scope:{popup:"@"},link:function(scope,element,attrs){function getPos(a){for(var b=0,c=0;;){if(b+=a.offsetLeft,c+=a.offsetTop,null===a.offsetParent)break;a=a.offsetParent}return[b,c]}var class_name="",popup_meta_data=eval("("+scope.popup+")"),title=popup_meta_data.title;void 0==title&&(title="");var content=popup_meta_data.content;void 0==content&&(content="");var position=popup_meta_data.position;void 0==position&&(position="top");var size=popup_meta_data.size;void 0==size&&(size="small"),class_name="left"==position?"ui popup left center transition visible "+size:"right"==position?"ui popup right center transition visible "+size:"bottom"==position?"ui popup bottom center transition visible "+size:"ui popup top center transition visible "+size;var current_element_position_top_left=getPos(element[0]),current_element_height=element[0].offsetHeight,current_element_width=element[0].offsetWidth;NodeList.prototype.remove=HTMLCollection.prototype.remove=function(){for(var a=0,b=this.length;b>a;a++)this[a]&&this[a].parentElement&&this[a].parentElement.removeChild(this[a])},element.bind("mouseenter",function(){var a='
'+title+'
'+content+"
";angular.element(element[0]).append(a);var b=document.getElementById("my-popup").clientHeight,c=document.getElementById("my-popup").clientWidth;"left"==position?(document.getElementById("my-popup").style.top=current_element_position_top_left[1]+current_element_height/2-b/2+"px",document.getElementById("my-popup").style.right="auto",document.getElementById("my-popup").style.left=current_element_position_top_left[0]-c-10+"px",document.getElementById("my-popup").style.bottom="auto",document.getElementById("my-popup").style.display="inline-block"):"right"==position?(document.getElementById("my-popup").style.top=current_element_position_top_left[1]+current_element_height/2-b/2+"px",document.getElementById("my-popup").style.right="auto",document.getElementById("my-popup").style.left=current_element_position_top_left[0]+current_element_width+"px",document.getElementById("my-popup").style.bottom="auto",document.getElementById("my-popup").style.display="inline-block"):"bottom"==position?(document.getElementById("my-popup").style.top=current_element_position_top_left[1]+current_element_height+"px",document.getElementById("my-popup").style.left=current_element_position_top_left[0]+current_element_width/2-c/2+15+"px",document.getElementById("my-popup").style.right="auto",document.getElementById("my-popup").style.bottom="auto",document.getElementById("my-popup").style.display="inline-block"):(document.getElementById("my-popup").style.top=current_element_position_top_left[1]-b-10+"px",document.getElementById("my-popup").style.left=current_element_position_top_left[0]+current_element_width/2-c/2+18+"px",document.getElementById("my-popup").style.right="auto",document.getElementById("my-popup").style.bottom="auto",document.getElementById("my-popup").style.display="inline-block")}),element.bind("mouseleave",function(){document.getElementsByClassName("ui popup bottom center transition visible").remove(),null!==document.getElementById("my-popup")&&document.getElementById("my-popup").remove()})}}}),angular.module("angularify.semantic.sidebar",[]).directive("sidebar",sidebar).directive("sidebarLink",sidebarLink).directive("sidebarItem",sidebarItem).directive("sidebarItemGroup",sidebarItemGroup),angular.module("angularify.semantic.rating",[]).directive("rating",function(){return{restrict:"E",replace:!0,transclude:!0,scope:{id:"@",size:"@",type:"@",model:"=ngModel"},template:'
',link:function(a,b,c){void 0==a.model&&(a.model=0),a.model<1&&a.model>5&&(a.model=0);var d=!1;void 0==a.type&&(a.type="star"),void 0==a.size?a.div_class="ui rating "+a.type:"small"==a.size?a.div_class="ui small "+a.type+" rating":"large"==a.size?a.div_class="ui large "+a.type+" rating":"huge"==a.size&&(a.div_class="ui huge "+a.type+" rating"),a.icon_class="icon",a.mouse_enter=function(b){if(1!=d){var c=1;for(c;b>=c;c++)document.getElementById(a.id+c).className="icon active"}},a.mouse_leave=function(b){if(1!=d){var c=1;for(c;5>=c;c++)document.getElementById(a.id+c).className="icon"}},a.click=function(b,c){var e=1;for(e;b>=e;e++)document.getElementById(a.id+e).className="icon active";0!==b&&(d=!0)},a.$watch("model",function(b){a.click(b)})}}}),angular.module("angularify.semantic.wizard",[]).controller("WizardController",["$scope",function(a){function b(){a.steps.forEach(function(a){a.selected=!1}),a.selectedStep=null}a.steps=[],a.currentStep=null,a.stepsLength="",a.$watch("currentStep",function(b){if(b){var c=a.selectedStep.title;a.selectedStep&&c!==a.currentStep&&a.goTo(a.steps.filter(function(b){return b.title==-a.currentStep})[0])}}),a.$watch("[editMode, steps.length]",function(){var b=a.editMode;void 0!==b&&null!==b&&b&&a.steps.forEach(function(a){a.completed=!0})},!0),this.addStep=function(b){a.steps.push(b),1===a.steps.length&&a.goTo(a.steps[0])},a.goTo=function(c){b(),a.selectedStep=c,void 0!==a.currentStep&&(a.currentStep=c.title),c.selected=!0,a.$emit("wizard:stepChanged",{step:c,index:a.steps.indexOf(c)})},this.next=function(){var b=a.steps.indexOf(a.selectedStep);a.selectedStep.completed=!0,b===a.steps.length-1?this.finish():a.goTo(a.steps[b+1])},this.goTo=function(b){var c;c=angular.isNumber(b)?a.steps[b]:a.steps.filter(function(a){return a.title===a})[0],a.goTo(c)},this.finish=function(){a.onFinish&&(a.selectedStep.completed=!0,a.onFinish())},this.cancel=this.previous=function(){var b=a.steps.indexOf(a.selectedStep);if(0===b)throw new Error("Cant go back. Its already in step 0");a.goTo(a.steps[b-1])},a.getStatus=function(a){var b=[];return a.selected&&b.push("active"),a.selected||a.completed||b.push("disabled"),a.completed&&b.push("completed"),b}}]).directive("wizard",function(){return{restrict:"EA",replace:!0,transclude:!0,scope:{fullwidth:"@",currentStep:"=?",onFinish:"&",editMode:"=",name:"@"},controller:"WizardController",template:'
{{step.title}}
',link:function(a,b,c,d){if("true"===a.fullwidth){var e={0:"",1:"one",2:"two",3:"three",4:"four",5:"five",6:"six",7:"seven",8:"eight",9:"nine",10:"ten"};a.stepsLength=e[a.steps.length]}}}}).directive("wizardPane",function(){return{restrict:"EA",replace:!0,transclude:!0,require:"^wizard",controller:"WizardController",scope:{title:"@"},template:'
',link:function(a,b,c,d){d.addStep(a)}}}),wizardButtonDirective("wzNext"),wizardButtonDirective("wzPrevious"),wizardButtonDirective("wzFinish"),wizardButtonDirective("wzCancel"); \ No newline at end of file diff --git a/package.json b/package.json index cc01e60..fdbd6e2 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,9 @@ "type": "git", "url": "https://github.com/angularify/angular-semantic-ui.git" }, + "scripts": { + "postinstall": "bower install" + }, "licenses": [ { "type": "MIT", @@ -40,4 +43,4 @@ "semver": "~2.2.0", "shelljs": "~0.2.0" } -} \ No newline at end of file +}