diff --git a/dist/js/components/list-actions.js b/dist/js/components/list-actions.js new file mode 100644 index 00000000..e69de29b diff --git a/dist/js/components/notifications.js b/dist/js/components/notifications.js index 8fd21144..a6c9b85c 100644 --- a/dist/js/components/notifications.js +++ b/dist/js/components/notifications.js @@ -111,12 +111,13 @@ } }; - var buildNotif = function(text, timeout, showButton) { + var buildNotif = function(text, timeout, showButton, textButton) { if(typeof text !== 'string') text = ''; timeout = (typeof timeout === 'number' ? timeout : 5000); + textButton = (typeof textButton === 'string' ? textButton : 'CANCEL'); var progress = '
'; - var btn = (showButton === true ? '' : ''); + var btn = (showButton === true ? '' : ''); var div = document.createElement('div'); div.setAttribute('class', 'notification'); @@ -202,12 +203,12 @@ } } - phonon.notif = function(el, timeout, showButton) { + phonon.notif = function(el, timeout, showButton, textButton) { if(arguments.length > 1) { var text = el; - var nBuild = buildNotif(text, timeout, showButton); + var nBuild = buildNotif(text, timeout, showButton, textButton); window.setTimeout(function() { show(document.querySelector('#'+nBuild.id)); }, 10); diff --git a/dist/js/phonon.js b/dist/js/phonon.js index ebf4945d..7a243f3c 100644 --- a/dist/js/phonon.js +++ b/dist/js/phonon.js @@ -3085,12 +3085,13 @@ phonon.tagManager = (function () { } }; - var buildNotif = function(text, timeout, showButton) { + var buildNotif = function(text, timeout, showButton, textButton) { if(typeof text !== 'string') text = ''; timeout = (typeof timeout === 'number' ? timeout : 5000); + textButton = (typeof textButton === 'string' ? textButton : 'CANCEL'); var progress = '
'; - var btn = (showButton === true ? '' : ''); + var btn = (showButton === true ? '' : ''); var div = document.createElement('div'); div.setAttribute('class', 'notification'); @@ -3176,12 +3177,12 @@ phonon.tagManager = (function () { } } - phonon.notif = function(el, timeout, showButton) { + phonon.notif = function(el, timeout, showButton, textButton) { if(arguments.length > 1) { var text = el; - var nBuild = buildNotif(text, timeout, showButton); + var nBuild = buildNotif(text, timeout, showButton, textButton); window.setTimeout(function() { show(document.querySelector('#'+nBuild.id)); }, 10); diff --git a/examples/components/notifications-example/index.html b/examples/components/notifications-example/index.html index 1a148b31..0b13f2de 100644 --- a/examples/components/notifications-example/index.html +++ b/examples/components/notifications-example/index.html @@ -27,6 +27,8 @@

Notifications

+ + @@ -55,6 +57,10 @@

Notifications

document.querySelector('#show-auto-notif').on('tap', function() { phonon.notif('HELLO', 3000, false); }); + + document.querySelector('#show-notif-button').on('tap', function() { + phonon.notif('HELLO AGAIN :-p', 3000, true, 'Close' ); + }); document.querySelector('#show-notif').on('tap', function() { phonon.notif('#notif-example').show();