Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions angular-bootstrap-checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ angular.module("ui.checkbox", []).directive("checkbox", function() {
scope: {},
require: "ngModel",
restrict: "E",
replace: "true",
template: "<button type=\"button\" ng-style=\"stylebtn\" class=\"btn btn-default\" ng-class=\"{'btn-xs': size==='default', 'btn-sm': size==='large', 'btn-lg': size==='largest'}\">" +
"<span ng-style=\"styleicon\" class=\"glyphicon\" ng-class=\"{'glyphicon-ok': checked===true}\"></span>" +
"</button>",
//replace: "true",
templateUrl: 'template/angular-bootstrap-checkbox/checkbox.html',
link: function(scope, elem, attrs, modelCtrl) {
scope.size = "default";
// Default Button Styling
Expand All @@ -18,17 +16,17 @@ angular.module("ui.checkbox", []).directive("checkbox", function() {
// If size is undefined, Checkbox has normal size (Bootstrap 'xs')
if(attrs.large !== undefined) {
scope.size = "large";
scope.stylebtn = {"padding-top": "2px", "padding-bottom": "2px", "height": "30px"};
scope.stylebtn = {"padding-top": "2px", "padding-bottom": "2px", "height": "30px", "width":"30px"};
scope.styleicon = {"width": "8px", "left": "-5px", "font-size": "17px"};
}
if(attrs.larger !== undefined) {
scope.size = "larger";
scope.stylebtn = {"padding-top": "2px", "padding-bottom": "2px", "height": "34px"};
scope.stylebtn = {"padding-top": "2px", "padding-bottom": "2px", "height": "34px", "width":"34px"};
scope.styleicon = {"width": "8px", "left": "-8px", "font-size": "22px"};
}
if(attrs.largest !== undefined) {
scope.size = "largest";
scope.stylebtn = {"padding-top": "2px", "padding-bottom": "2px", "height": "45px"};
scope.stylebtn = {"padding-top": "2px", "padding-bottom": "2px", "height": "45px", "width":"45px"};
scope.styleicon = {"width": "11px", "left": "-11px", "font-size": "30px"};
}

Expand Down
3 changes: 3 additions & 0 deletions template/angular-bootstrap-checkbox/checkbox.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<button type="button" ng-style="stylebtn" class="btn btn-default" ng-class="{'btn-xs': size==='default', 'btn-sm': size==='large', 'btn-lg': size==='largest'}">
<span ng-style="styleicon" class="glyphicon" ng-class="{'glyphicon-ok': checked===true}"></span>
</button>