Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

progressBarInverse: Growing Progress Bar. #201

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ app.config(function(toastrConfig) {
* **iconClasses**: The default type classes for the different toasts.
* **messageClass**: The class for the toast's message.
* **progressBar**: A progress bar to see the timeout in real time.
* **progressBarInverse**: Growing Progress Bar.
* **tapToDismiss**: Whether the toast should be dismissed when it is clicked.
* **templates**: To override the default path of the templates.
* **timeOut**: The timeout before the toasts disappear.
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-toastr",
"version": "2.1.1",
"version": "2.1.2",
"authors": [
"Jesus Rodriguez <[email protected]>"
],
Expand Down
5 changes: 5 additions & 0 deletions dist/angular-toastr.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@
onShown: generateEvent('onShown'),
onTap: generateEvent('onTap'),
progressBar: options.progressBar,
progressBarInverse: options.progressBarInverse,
tapToDismiss: options.tapToDismiss,
timeOut: options.timeOut,
titleClass: options.titleClass,
Expand Down Expand Up @@ -318,6 +319,7 @@
preventDuplicates: false,
preventOpenDuplicates: false,
progressBar: false,
progressBarInverse: false,
tapToDismiss: true,
target: 'body',
templates: {
Expand Down Expand Up @@ -351,6 +353,7 @@
var intervalId, currentTimeOut, hideTime;

toastCtrl.progressBar = scope;
toastCtrl.progressBarInverse = "true" === attrs.progressBarInverse;

scope.start = function(duration) {
if (intervalId) {
Expand All @@ -370,6 +373,7 @@

function updateProgress() {
var percentage = ((hideTime - (new Date().getTime())) / currentTimeOut) * 100;
if(toastCtrl.progressBarInverse) percentage = 100 - percentage;
element.css('width', percentage + '%');
}

Expand Down Expand Up @@ -428,6 +432,7 @@
scope.titleClass = scope.options.titleClass;
scope.messageClass = scope.options.messageClass;
scope.progressBar = scope.options.progressBar;
scope.progressBarInverse = scope.options.progressBarInverse;

if (wantsCloseButton()) {
var button = angular.element(scope.options.closeHtml),
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-toastr.min.js

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

Loading