angular-bootstrap-confirm
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "angular-bootstrap-confirm", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"homepage": "https://github.com/mattlewis92/angular-bootstrap-confirm", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -0,1 +1,12 @@ | ||
<a name="1.0.1"></a> | ||
## [1.0.1](https://github.com/mattlewis92/angular-bootstrap-confirm/compare/1.0.0...v1.0.1) (2016-04-20) | ||
### Bug Fixes | ||
* mark `focusConfirmButton` and `isDisabled` as optional ([7c3dc30](https://github.com/mattlewis92/angular-bootstrap-confirm/commit/7c3dc30)) | ||
* **isOpen:** only update `isOpen` when the popover visibility is actually changed ([6d78209](https://github.com/mattlewis92/angular-bootstrap-confirm/commit/6d78209)), closes [#18](https://github.com/mattlewis92/angular-bootstrap-confirm/issues/18) | ||
<a name="1.0.0"></a> | ||
@@ -2,0 +13,0 @@ # [1.0.0](https://github.com/mattlewis92/angular-bootstrap-confirm/compare/0.7.0...v1.0.0) (2015-12-16) |
/** | ||
* angular-bootstrap-confirm - Displays a bootstrap confirmation popover when clicking the given element. | ||
* @version v1.0.0 | ||
* @version v1.0.1 | ||
* @link https://github.com/mattlewis92/angular-bootstrap-confirm | ||
@@ -120,4 +120,4 @@ * @license MIT | ||
vm.isVisible = true; | ||
vm.isOpen = true; | ||
} | ||
vm.isOpen = true; | ||
} | ||
@@ -132,4 +132,4 @@ | ||
} | ||
vm.isOpen = false; | ||
} | ||
vm.isOpen = false; | ||
} | ||
@@ -201,5 +201,5 @@ | ||
isOpen: '=?', | ||
focusConfirmButton: '=', | ||
focusConfirmButton: '=?', | ||
templateUrl: '@', | ||
isDisabled: '=' | ||
isDisabled: '=?' | ||
} | ||
@@ -206,0 +206,0 @@ }; |
/** | ||
* angular-bootstrap-confirm - Displays a bootstrap confirmation popover when clicking the given element. | ||
* @version v1.0.0 | ||
* @version v1.0.1 | ||
* @link https://github.com/mattlewis92/angular-bootstrap-confirm | ||
* @license MIT | ||
*/ | ||
!function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("angular"),require("angular-sanitize")):"function"==typeof define&&define.amd?define(["angular","angular-sanitize"],e):"object"==typeof exports?exports.angularBootstrapConfirmModuleName=e(require("angular"),require("angular-sanitize")):n.angularBootstrapConfirmModuleName=e(n.angular,n["angular-sanitize"])}(this,function(n,e){return function(n){function e(t){if(o[t])return o[t].exports;var i=o[t]={exports:{},id:t,loaded:!1};return n[t].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var o={};return e.m=n,e.c=o,e.p="",e(0)}([function(n,e,o){"use strict";var t=o(1),i=o(2);o(3),o(1);var r="angular-bootstrap-confirm.html";n.exports=t.module("mwl.confirm",["ngSanitize","ui.bootstrap.position"]).run(["$templateCache",function(n){n.put(r,i)}]).controller("PopoverConfirmCtrl",["$scope","$element","$compile","$document","$window","$timeout","$injector","$templateRequest","confirmationPopoverDefaults",function(n,e,o,i,r,s,c,l,a){function p(){var n=x.positionElements(e,b.popover,b.popoverPlacement,!0);n.top+="px",n.left+="px",b.popover.css(n)}function u(n){var e=t.isDefined(b.focusConfirmButton)?b.focusConfirmButton:b.defaults.focusConfirmButton;e&&n[0].focus()}function m(){b.isVisible||b.isDisabled||(b.popover.css({display:"block"}),p(),u(b.popover[0].getElementsByClassName("confirm-button")),b.isVisible=!0),b.isOpen=!0}function f(n){b.isVisible&&(b.popover.css({display:"none"}),b.isVisible=!1,n&&u(e)),b.isOpen=!1}function v(){b.isVisible?f():m(),n.$apply()}function d(o){!b.isVisible||b.popover[0].contains(o.target)||e[0].contains(o.target)||(f(),n.$apply())}var b=this;b.defaults=a,b.popoverPlacement=b.placement||b.defaults.placement;var g=c.has("$uibPosition")?"$uibPosition":"$position",x=c.get(g),C=b.templateUrl||a.templateUrl;l(C).then(function(e){b.popover=t.element(e),b.popover.css("display","none"),o(b.popover)(n),i.find("body").append(b.popover)}),b.isVisible=!1,b.showPopover=m,b.hidePopover=f,b.togglePopover=v,n.$watch("vm.isOpen",function(n){s(function(){n?m():f()})}),e.bind("click",v),r.addEventListener("resize",p),i.bind("click",d),i.bind("touchend",d),n.$on("$destroy",function(){b.popover.remove(),e.unbind("click",v),r.removeEventListener("resize",p),i.unbind("click",d),i.unbind("touchend",d)})}]).directive("mwlConfirm",function(){return{restrict:"EA",controller:"PopoverConfirmCtrl as vm",bindToController:!0,scope:{confirmText:"@",cancelText:"@",message:"@",title:"@",placement:"@",onConfirm:"&",onCancel:"&",confirmButtonType:"@",cancelButtonType:"@",isOpen:"=?",focusConfirmButton:"=",templateUrl:"@",isDisabled:"="}}}).value("confirmationPopoverDefaults",{confirmText:"Confirm",cancelText:"Cancel",confirmButtonType:"success",cancelButtonType:"default",placement:"top",focusConfirmButton:!0,templateUrl:r}).name},function(e,o){e.exports=n},function(n,e){n.exports='<div class="popover" ng-class="vm.popoverPlacement">\n <div class="arrow"></div>\n <h3 class="popover-title" ng-bind-html="vm.title"></h3>\n <div class="popover-content">\n <p ng-bind-html="vm.message"></p>\n <div class="row">\n <div class="col-xs-6">\n <button\n class="btn btn-block confirm-button"\n ng-class="\'btn-\' + (vm.confirmButtonType || vm.defaults.confirmButtonType)"\n ng-click="vm.onConfirm(); vm.hidePopover()"\n ng-bind-html="vm.confirmText || vm.defaults.confirmText">\n </button>\n </div>\n <div class="col-xs-6">\n <button\n class="btn btn-block cancel-button"\n ng-class="\'btn-\' + (vm.cancelButtonType || vm.defaults.cancelButtonType)"\n ng-click="vm.onCancel(); vm.hidePopover(true)"\n ng-bind-html="vm.cancelText || vm.defaults.cancelText">\n </button>\n </div>\n </div>\n </div>\n</div>\n'},function(n,o){n.exports=e}])}); | ||
!function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("angular"),require("angular-sanitize")):"function"==typeof define&&define.amd?define(["angular","angular-sanitize"],e):"object"==typeof exports?exports.angularBootstrapConfirmModuleName=e(require("angular"),require("angular-sanitize")):n.angularBootstrapConfirmModuleName=e(n.angular,n["angular-sanitize"])}(this,function(n,e){return function(n){function e(t){if(o[t])return o[t].exports;var i=o[t]={exports:{},id:t,loaded:!1};return n[t].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var o={};return e.m=n,e.c=o,e.p="",e(0)}([function(n,e,o){"use strict";var t=o(1),i=o(2);o(3),o(1);var r="angular-bootstrap-confirm.html";n.exports=t.module("mwl.confirm",["ngSanitize","ui.bootstrap.position"]).run(["$templateCache",function(n){n.put(r,i)}]).controller("PopoverConfirmCtrl",["$scope","$element","$compile","$document","$window","$timeout","$injector","$templateRequest","confirmationPopoverDefaults",function(n,e,o,i,r,s,c,l,a){function p(){var n=x.positionElements(e,b.popover,b.popoverPlacement,!0);n.top+="px",n.left+="px",b.popover.css(n)}function u(n){var e=t.isDefined(b.focusConfirmButton)?b.focusConfirmButton:b.defaults.focusConfirmButton;e&&n[0].focus()}function m(){b.isVisible||b.isDisabled||(b.popover.css({display:"block"}),p(),u(b.popover[0].getElementsByClassName("confirm-button")),b.isVisible=!0,b.isOpen=!0)}function f(n){b.isVisible&&(b.popover.css({display:"none"}),b.isVisible=!1,n&&u(e),b.isOpen=!1)}function v(){b.isVisible?f():m(),n.$apply()}function d(o){!b.isVisible||b.popover[0].contains(o.target)||e[0].contains(o.target)||(f(),n.$apply())}var b=this;b.defaults=a,b.popoverPlacement=b.placement||b.defaults.placement;var g=c.has("$uibPosition")?"$uibPosition":"$position",x=c.get(g),C=b.templateUrl||a.templateUrl;l(C).then(function(e){b.popover=t.element(e),b.popover.css("display","none"),o(b.popover)(n),i.find("body").append(b.popover)}),b.isVisible=!1,b.showPopover=m,b.hidePopover=f,b.togglePopover=v,n.$watch("vm.isOpen",function(n){s(function(){n?m():f()})}),e.bind("click",v),r.addEventListener("resize",p),i.bind("click",d),i.bind("touchend",d),n.$on("$destroy",function(){b.popover.remove(),e.unbind("click",v),r.removeEventListener("resize",p),i.unbind("click",d),i.unbind("touchend",d)})}]).directive("mwlConfirm",function(){return{restrict:"EA",controller:"PopoverConfirmCtrl as vm",bindToController:!0,scope:{confirmText:"@",cancelText:"@",message:"@",title:"@",placement:"@",onConfirm:"&",onCancel:"&",confirmButtonType:"@",cancelButtonType:"@",isOpen:"=?",focusConfirmButton:"=?",templateUrl:"@",isDisabled:"=?"}}}).value("confirmationPopoverDefaults",{confirmText:"Confirm",cancelText:"Cancel",confirmButtonType:"success",cancelButtonType:"default",placement:"top",focusConfirmButton:!0,templateUrl:r}).name},function(e,o){e.exports=n},function(n,e){n.exports='<div class="popover" ng-class="vm.popoverPlacement">\n <div class="arrow"></div>\n <h3 class="popover-title" ng-bind-html="vm.title"></h3>\n <div class="popover-content">\n <p ng-bind-html="vm.message"></p>\n <div class="row">\n <div class="col-xs-6">\n <button\n class="btn btn-block confirm-button"\n ng-class="\'btn-\' + (vm.confirmButtonType || vm.defaults.confirmButtonType)"\n ng-click="vm.onConfirm(); vm.hidePopover()"\n ng-bind-html="vm.confirmText || vm.defaults.confirmText">\n </button>\n </div>\n <div class="col-xs-6">\n <button\n class="btn btn-block cancel-button"\n ng-class="\'btn-\' + (vm.cancelButtonType || vm.defaults.cancelButtonType)"\n ng-click="vm.onCancel(); vm.hidePopover(true)"\n ng-bind-html="vm.cancelText || vm.defaults.cancelText">\n </button>\n </div>\n </div>\n </div>\n</div>\n'},function(n,o){n.exports=e}])}); | ||
//# sourceMappingURL=angular-bootstrap-confirm.min.js.map |
{ | ||
"name": "angular-bootstrap-confirm", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Displays a bootstrap confirmation popover when clicking the given element.", | ||
@@ -15,4 +15,4 @@ "browser": "dist/angular-bootstrap-confirm.js", | ||
"start": "webpack-dev-server", | ||
"commit": "commit-wizard", | ||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -w" | ||
"commit": "git-cz", | ||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s" | ||
}, | ||
@@ -36,12 +36,19 @@ "repository": { | ||
"devDependencies": { | ||
"angular": ">=1.3.0", | ||
"angular-mocks": ">=1.3.0", | ||
"conventional-changelog": "~0.5.1", | ||
"eslint": "~1.10.3", | ||
"eslint-config-mwl": "~0.3.0", | ||
"eslint-loader": "~1.1.0", | ||
"eslint-plugin-angular": "~0.15.0", | ||
"istanbul-instrumenter-loader": "~0.1.3", | ||
"jquery": "~2.1.4", | ||
"angular-sanitize": ">=1.3.0", | ||
"bootstrap": "^3.3.6", | ||
"commitizen": "~2.7.6", | ||
"conventional-changelog": "~1.1.0", | ||
"conventional-changelog-cli": "~1.1.1", | ||
"cz-conventional-changelog": "~1.1.5", | ||
"eslint": "~2.8.0", | ||
"eslint-config-mwl": "~0.4.0", | ||
"eslint-loader": "~1.3.0", | ||
"eslint-plugin-angular": "~1.0.0", | ||
"ghooks": "~1.2.1", | ||
"istanbul-instrumenter-loader": "~0.2.0", | ||
"jquery": "~2.2.0", | ||
"karma": "~0.13.9", | ||
"karma-chai-plugins": "~0.6.0", | ||
"karma-chai-plugins": "~0.7.0", | ||
"karma-chrome-launcher": "~0.2.0", | ||
@@ -51,14 +58,13 @@ "karma-coverage": "~0.5.1", | ||
"karma-mocha": "~0.2.0", | ||
"karma-phantomjs-launcher": "~0.2.0", | ||
"karma-phantomjs-launcher": "~1.0.0", | ||
"karma-sourcemap-loader": "~0.3.5", | ||
"karma-webpack": "~1.7.0", | ||
"mocha": "~2.3.3", | ||
"ng-annotate-loader": "0.0.10", | ||
"node-libs-browser": "~0.5.2", | ||
"mocha": "~2.4.5", | ||
"ng-annotate-loader": "~0.1.0", | ||
"open": "0.0.5", | ||
"phantomjs": "~1.9.17", | ||
"pre-git": "~3.1.1", | ||
"phantomjs-prebuilt": "~2.1.7", | ||
"raw-loader": "~0.5.1", | ||
"uglify-loader": "~1.3.0", | ||
"webpack": "~1.12.0", | ||
"validate-commit-msg": "~2.6.1", | ||
"webpack": "~1.13.0", | ||
"webpack-dev-server": "~1.14.0" | ||
@@ -69,9 +75,12 @@ }, | ||
"angular-sanitize": ">=1.3.0", | ||
"bootstrap": "^3.3.5" | ||
"bootstrap": "^3.3.6" | ||
}, | ||
"config": { | ||
"pre-git": { | ||
"commit-msg": "conventional" | ||
"ghooks": { | ||
"commit-msg": "validate-commit-msg" | ||
}, | ||
"commitizen": { | ||
"path": "node_modules/cz-conventional-changelog" | ||
} | ||
} | ||
} |
@@ -58,4 +58,4 @@ 'use strict'; | ||
vm.isVisible = true; | ||
vm.isOpen = true; | ||
} | ||
vm.isOpen = true; | ||
} | ||
@@ -70,4 +70,4 @@ | ||
} | ||
vm.isOpen = false; | ||
} | ||
vm.isOpen = false; | ||
} | ||
@@ -139,5 +139,5 @@ | ||
isOpen: '=?', | ||
focusConfirmButton: '=', | ||
focusConfirmButton: '=?', | ||
templateUrl: '@', | ||
isDisabled: '=' | ||
isDisabled: '=?' | ||
} | ||
@@ -144,0 +144,0 @@ }; |
@@ -362,2 +362,9 @@ 'use strict'; | ||
it('should not mark isOpen as true when the popover is disabled', function() { | ||
scope.isOpen = false; | ||
createPopover('<button mwl-confirm is-open="isOpen" is-disabled="true">Test</button>'); | ||
$(element).click(); | ||
expect(scope.isOpen).to.be.false; | ||
}); | ||
}); | ||
@@ -401,4 +408,5 @@ | ||
})); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
82214
1012
33