Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LukaszWatroba committed Jun 26, 2015
1 parent 6a0618d commit 3117db9
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 21 deletions.
5 changes: 3 additions & 2 deletions dist/v-button.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* vButton - AngularJS pressable button with a busy indicator
* @version v1.0.0
* @version v1.1.0
* @link http://lukaszwatroba.github.io/v-button
* @author Łukasz Wątroba <[email protected]>
* @license MIT License, http://www.opensource.org/licenses/MIT
Expand Down Expand Up @@ -58,7 +58,8 @@
[v-pressable] {
overflow: hidden;
position: relative;
transition: all 0.25s; }
-webkit-transition: all 0.25s;
transition: all 0.25s; }
[v-pressable].is-pressed {
-webkit-transform: scale(0.95);
-ms-transform: scale(0.95);
Expand Down
21 changes: 15 additions & 6 deletions dist/v-button.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* vButton - AngularJS pressable button with a busy indicator
* @version v1.0.0
* @version v1.1.0
* @link http://lukaszwatroba.github.io/v-button
* @author Łukasz Wątroba <[email protected]>
* @license MIT License, http://www.opensource.org/licenses/MIT
Expand Down Expand Up @@ -44,9 +44,10 @@ function vBusyDirective ($document, buttonConfig) {
restrict: 'A',
scope: {
isBusy: '=vBusy',
busyLabel: '@vBusyLabel'
busyLabel: '@vBusyLabel',
busyText: '@vBusyText'
},
compile: function (tElement) {
compile: function (tElement, tAttrs) {
var labelElement = angular.element(tElement.find('span'));

if (!labelElement[0]) {
Expand All @@ -56,17 +57,26 @@ function vBusyDirective ($document, buttonConfig) {

return function postLink (scope, iElement) {
var idleLabelHtml = labelElement.html(),
busyLabelHtml = scope.busyLabel || buttonConfig.busyLabel;
busyLabelHtml = scope.busyLabel || buttonConfig.busyLabel,
busyTextHtml = scope.busyText;

scope.$watch('isBusy', function (value) {
if (value) {
iElement.addClass(buttonConfig.states.busy);
labelElement.html(busyLabelHtml);
} else {
iElement.removeClass(buttonConfig.states.busy);
labelElement.html(idleLabelHtml);
labelElement.html(busyTextHtml || idleLabelHtml);
}
});

tAttrs.$observe('vBusyLabel', function(value) {
busyLabelHtml = value;
});

tAttrs.$observe('vBusyText', function(value) {
busyTextHtml = value;
});
};
}
};
Expand All @@ -75,7 +85,6 @@ vBusyDirective.$inject = ['$document', 'buttonConfig'];




// vPressable directive
angular.module('vButton.directives')
.directive('vPressable', vPressableDirective);
Expand Down
4 changes: 2 additions & 2 deletions dist/v-button.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/v-button.min.js
100755 → 100644

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ <h5 class="u-marginBl">AngularJS pressable button with a busy indicator.</h5>
<button class="Button Button--default" v-pressable>Pressable Button</button>
</li>
<li class="ButtonGroup-item u-marginAs">
<button class="Button Button--default" ng-click="isLoading = !isLoading" v-busy="isLoading" v-busy-label="Please wait" v-pressable>Busy Button</button>
<button class="Button Button--default" ng-click="isLoading = !isLoading" v-busy="isLoading" v-busy-text="" v-busy-label="Please wait" v-pressable>Busy Button</button>
</li>
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "v-button",
"description": "vButton - AngularJS pressable button with a busy indicator",
"version": "1.0.0",
"version": "1.1.0",
"author": "Łukasz Wątroba <[email protected]>",
"license": "MIT",
"keywords": [
Expand Down
11 changes: 4 additions & 7 deletions src/vButton/directives/v-busy.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,15 @@ function vBusyDirective ($document, buttonConfig) {
}
});

tAttrs.$observe('vBusyLabel', function(value)
{
busyLabelHtml = value;
tAttrs.$observe('vBusyLabel', function(value) {
busyLabelHtml = value;
});

tAttrs.$observe('vBusyText', function(value)
{
busyTextHtml = value;
tAttrs.$observe('vBusyText', function(value) {
busyTextHtml = value;
});
};
}
};
}
vBusyDirective.$inject = ['$document', 'buttonConfig'];

0 comments on commit 3117db9

Please sign in to comment.