Files
pathfinder/build_js/lib/pnotify/pnotify.reference.js
2015-05-10 18:18:56 +02:00

1 line
1.6 KiB
JavaScript

!function(t){"function"==typeof define&&define.amd?define("pnotify.reference",["jquery","pnotify"],t):t(jQuery,PNotify)}(function(t,e){e.prototype.options.reference={putThing:!1,labels:{text:"Spin Around"}};e.prototype.modules.reference={thingElem:null,init:function(e,n){var i=this;if(n.putThing){this.thingElem=t('<button style="float:right;" class="btn btn-default" type="button" disabled><i class="'+e.styles.athing+'" />&nbsp;'+n.labels.text+"</button>").appendTo(e.container);e.container.append('<div style="clear: right; line-height: 0;" />');e.elem.on({mouseenter:function(){i.thingElem.prop("disabled",!1)},mouseleave:function(){i.thingElem.prop("disabled",!0)}});this.thingElem.on("click",function(){var t=0,n=setInterval(function(){t+=10;if(360==t){t=0;clearInterval(n)}e.elem.css({"-moz-transform":"rotate("+t+"deg)","-webkit-transform":"rotate("+t+"deg)","-o-transform":"rotate("+t+"deg)","-ms-transform":"rotate("+t+"deg)",filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation="+t/360*4+")"})},20)})}},update:function(t,e){e.putThing&&this.thingElem?this.thingElem.show():!e.putThing&&this.thingElem&&this.thingElem.hide();this.thingElem&&this.thingElem.find("i").attr("class",t.styles.athing)},beforeOpen:function(){},afterOpen:function(){},beforeClose:function(){},afterClose:function(){},beforeDestroy:function(){},afterDestroy:function(){}};t.extend(e.styling.jqueryui,{athing:"ui-icon ui-icon-refresh"});t.extend(e.styling.bootstrap2,{athing:"icon-refresh"});t.extend(e.styling.bootstrap3,{athing:"glyphicon glyphicon-refresh"});t.extend(e.styling.fontawesome,{athing:"fa fa-refresh"})});