diff --git a/Gruntfile.js b/Gruntfile.js index aff14d1..3fdadea 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -81,7 +81,8 @@ module.exports = function (grunt) { 'module.exports = factory(require("tether"));' + '} else {' + 'root.test = factory(root.Tether)};' + - '}(this, function(Tether) {', + '}(this, function(Tether) {' + + ' ', footer: '}));' }, dist: { diff --git a/bower.json b/bower.json index d5f179a..ef93dcf 100755 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "angular-tether", - "version": "0.1.3", + "version": "0.1.4", "main": "./dist/angular-tether.js", "repository": { "type": "git", diff --git a/dist/angular-tether.js b/dist/angular-tether.js index a23211a..7204396 100644 --- a/dist/angular-tether.js +++ b/dist/angular-tether.js @@ -1,4 +1,4 @@ -/*! angular-tether - v0.1.3 - 2014-07-07 */(function (root, factory) {if (typeof define === "function" && define.amd) {define(["tether"], factory);} else if (typeof exports === "object") {module.exports = factory(require("tether"));} else {root.test = factory(root.Tether)};}(this, function(Tether) {angular.module('ngTetherPopover', ['ngTether']).directive('tetherPopover', [ +/*! angular-tether - v0.1.4 - 2014-07-09 */(function (root, factory) {if (typeof define === "function" && define.amd) {define(["tether"], factory);} else if (typeof exports === "object") {module.exports = factory(require("tether"));} else {root.test = factory(root.Tether)};}(this, function(Tether) { angular.module('ngTetherPopover', ['ngTether']).directive('tetherPopover', [ 'Tether', '$parse', 'Utils', diff --git a/dist/angular-tether.min.js b/dist/angular-tether.min.js index 22b60ec..89f0a71 100644 --- a/dist/angular-tether.min.js +++ b/dist/angular-tether.min.js @@ -1 +1 @@ -/*! angular-tether - v0.1.3 - 2014-07-07 */!function(a,b){"function"==typeof define&&define.amd?define(["tether"],b):"object"==typeof exports?module.exports=b(require("tether")):a.test=b(a.Tether)}(this,function(a){angular.module("ngTetherPopover",["ngTether"]).directive("tetherPopover",["Tether","$parse","Utils",function(a,b,c){return{restrict:"A",scope:{tetherPopover:"=",config:"="},link:function(b,d){b.tetherPopover=new a(c.extendDeep({parentScope:b.$parent,leaveOnBlur:!0,tether:{target:d[0],attachment:"top center",targetAttachment:"bottom center",constraints:[{to:"window",attachment:"together"}]}},b.config)),b.$watch("tetherPopover.config.targetAttachment",function(){b.tetherPopover.isActive()&&b.tetherPopover.position()},!0),b.$watch("tetherPopover.config.attachment",function(){b.tetherPopover.isActive()&&b.tetherPopover.position()},!0)}}}]),angular.module("ngTetherTooltip",["ngTether"]).directive("tetherTooltip",["Tether","Utils",function(a,b){return{scope:{content:"@tetherTooltip",config:"=config"},link:function(c,d){var e=new a(b.extendDeep({template:'
{{ content }}
',parentScope:c,tether:{target:d[0],attachment:"top center",targetAttachment:"bottom center",constraints:[{to:"window",attachment:"together",pin:!0}]}},c.config));d.on("mouseenter",function(){e.enter()}),d.on("mouseleave",function(){e.leave()}),c.$on("$destroy",function(){d.unbind("hover"),d.unbind("mouseleave")})}}}]),angular.module("ngTether",[]).factory("Utils",["$compile",function(){var a={};return a.extendDeep=function(a,b){for(var c in b)c in a?angular.extend(a[c],b[c]):a[c]=b[c];return a},a}]).factory("Tether",["$compile","$rootScope","$window","$animate","$controller","$timeout","$q","$http","$templateCache",function(b,c,d,e,f,g,h,i,j){return function(k){"use strict";function l(){u=new a(y({element:z[0]},k.tether))}function m(a,c){if(z=angular.element(a.trim()),s=x.$new(),c&&(s.$locals=c),k.controller)var d=f(v,{$scope:s});w&&(s[w]=d),b(z)(s),s.$on("$destroy",p),g(function(){e.enter(z,A),l(),u.position(),k.leaveOnBlur&&A.on("click",n)})}function n(a){var b=a.target;if(z&&b!==z[0]){for(;null!==b.parentElement;){if(b.parentElement==z[0])return;b=b.parentElement}return p()}}function o(a){t.then(function(b){m(b,a)})}function p(){return r()?(k.leaveOnBlur&&A.off("click",n),u.destroy(),void g(function(){z&&e.leave(z,function(){z=null})})):(z&&(z=null),!1)}function q(){z&&(e.move(z,A),l())}function r(){return u&&u.enabled}if(!(!k.template^!k.templateUrl))throw new Error("Expected one of either `template` or `templateUrl`");k.tether=k.tether||{};var s,t,u,v=k.controller||angular.noop,w=k.controllerAs,x=k.parentScope||c,y=angular.extend,z=null,A=angular.element(d.document.body);if(k.template){var B=h.defer();B.resolve(j.get(k.template)||k.template),t=B.promise}else t=i.get(k.templateUrl,{cache:j}).then(function(a){return a.data});return{enter:o,leave:p,position:q,isActive:r,tether:t,config:k.tether}}}])}); \ No newline at end of file +/*! angular-tether - v0.1.4 - 2014-07-09 */!function(a,b){"function"==typeof define&&define.amd?define(["tether"],b):"object"==typeof exports?module.exports=b(require("tether")):a.test=b(a.Tether)}(this,function(a){angular.module("ngTetherPopover",["ngTether"]).directive("tetherPopover",["Tether","$parse","Utils",function(a,b,c){return{restrict:"A",scope:{tetherPopover:"=",config:"="},link:function(b,d){b.tetherPopover=new a(c.extendDeep({parentScope:b.$parent,leaveOnBlur:!0,tether:{target:d[0],attachment:"top center",targetAttachment:"bottom center",constraints:[{to:"window",attachment:"together"}]}},b.config)),b.$watch("tetherPopover.config.targetAttachment",function(){b.tetherPopover.isActive()&&b.tetherPopover.position()},!0),b.$watch("tetherPopover.config.attachment",function(){b.tetherPopover.isActive()&&b.tetherPopover.position()},!0)}}}]),angular.module("ngTetherTooltip",["ngTether"]).directive("tetherTooltip",["Tether","Utils",function(a,b){return{scope:{content:"@tetherTooltip",config:"=config"},link:function(c,d){var e=new a(b.extendDeep({template:'
{{ content }}
',parentScope:c,tether:{target:d[0],attachment:"top center",targetAttachment:"bottom center",constraints:[{to:"window",attachment:"together",pin:!0}]}},c.config));d.on("mouseenter",function(){e.enter()}),d.on("mouseleave",function(){e.leave()}),c.$on("$destroy",function(){d.unbind("hover"),d.unbind("mouseleave")})}}}]),angular.module("ngTether",[]).factory("Utils",["$compile",function(){var a={};return a.extendDeep=function(a,b){for(var c in b)c in a?angular.extend(a[c],b[c]):a[c]=b[c];return a},a}]).factory("Tether",["$compile","$rootScope","$window","$animate","$controller","$timeout","$q","$http","$templateCache",function(b,c,d,e,f,g,h,i,j){return function(k){"use strict";function l(){u=new a(y({element:z[0]},k.tether))}function m(a,c){if(z=angular.element(a.trim()),s=x.$new(),c&&(s.$locals=c),k.controller)var d=f(v,{$scope:s});w&&(s[w]=d),b(z)(s),s.$on("$destroy",p),g(function(){e.enter(z,A),l(),u.position(),k.leaveOnBlur&&A.on("click",n)})}function n(a){var b=a.target;if(z&&b!==z[0]){for(;null!==b.parentElement;){if(b.parentElement==z[0])return;b=b.parentElement}return p()}}function o(a){t.then(function(b){m(b,a)})}function p(){return r()?(k.leaveOnBlur&&A.off("click",n),u.destroy(),void g(function(){z&&e.leave(z,function(){z=null})})):(z&&(z=null),!1)}function q(){z&&(e.move(z,A),l())}function r(){return u&&u.enabled}if(!(!k.template^!k.templateUrl))throw new Error("Expected one of either `template` or `templateUrl`");k.tether=k.tether||{};var s,t,u,v=k.controller||angular.noop,w=k.controllerAs,x=k.parentScope||c,y=angular.extend,z=null,A=angular.element(d.document.body);if(k.template){var B=h.defer();B.resolve(j.get(k.template)||k.template),t=B.promise}else t=i.get(k.templateUrl,{cache:j}).then(function(a){return a.data});return{enter:o,leave:p,position:q,isActive:r,tether:t,config:k.tether}}}])}); \ No newline at end of file diff --git a/src/angular-tether.js b/src/angular-tether.js index 4948bcc..a2d769b 100644 --- a/src/angular-tether.js +++ b/src/angular-tether.js @@ -130,7 +130,6 @@ angular.module('ngTether', []) } } - // bool. is tethered instance got destroyed function isActive() { return tether && tether.enabled;