Skip to content
This repository was archived by the owner on Jul 3, 2022. It is now read-only.

Commit 0a2971d

Browse files
author
Khaled Shaaban
committed
Merge branch 'release/0.2.1'. Fixes #9
2 parents a1b18a9 + 4600493 commit 0a2971d

5 files changed

Lines changed: 25 additions & 5 deletions

File tree

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ionic-durationpicker",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"authors": [
55
"Khaled Shaaban <kshaaban@outlook.com>"
66
],

dist/ionic-durationpicker.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@
8686
popupCancelButtonType: scope.idpConfig.popupCancelButtonType ? scope.idpConfig.popupCancelButtonType : 'button-stable'
8787
};
8888

89+
var _skipWatch = false;
90+
8991
scope.showPopup = _showPopup;
9092
scope.getItemClasses = _getItemClasses;
9193
scope.getInputButtonType = _getInputButtonType;
@@ -95,7 +97,13 @@
9597
scope.releaseHold = _releaseHold;
9698
scope.prettyFormatDuration = _prettyFormatDuration;
9799

98-
_initialize();
100+
scope.$watch('idpOutput', function(n, o) {
101+
if (!_skipWatch) {
102+
_initialize();
103+
}
104+
105+
_skipWatch = false;
106+
});
99107

100108
//////////////////////////////////////////////////
101109

@@ -244,6 +252,8 @@
244252
}
245253

246254
function __getDurationInSeconds() {
255+
_skipWatch = true;
256+
247257
scope.duration = angular.copy(scope.popupDuration);
248258
scope.idpOutput = parseInt(scope.duration.days * 86400) + parseInt(scope.duration.hours * 3600) + parseInt(scope.duration.minutes * 60) + parseInt(scope.duration.seconds);
249259
}

0 commit comments

Comments
 (0)