Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.

Commit 002399e

Browse files
committed
Added mscAlert.
1 parent ef64804 commit 002399e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "medium-style-confirm",
3-
"version": "0.3.2",
3+
"version": "0.4.0",
44
"homepage": "http://bitwiser.i/medium-style-confirm/",
55
"authors": [
66
"Brijesh Bittu <brijeshb42@gmail.com>"

js/msc-script.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,12 @@
6868
body.appendChild(ce('p','', options.subtitle));
6969

7070
action.appendChild(okBtn);
71-
action.appendChild(cancelbtn);
71+
if(type !== "alert") {
72+
action.appendChild(cancelbtn);
73+
cancelbtn.addEventListener('click', cancel);
74+
}
7275

7376
okBtn.addEventListener('click', ok);
74-
cancelbtn.addEventListener('click', cancel);
7577

7678
content.appendChild(cTitle);
7779
content.appendChild(body);
@@ -137,4 +139,7 @@
137139
window.mscPrompt = function(title, sub, onOk, onCancel) {
138140
buildUI(title, sub, onOk, onCancel, "prompt");
139141
};
142+
window.mscAlert = function(title, sub, onOk, onCancel) {
143+
buildUI(title, sub, onOk, onCancel, "alert");
144+
};
140145
})();

0 commit comments

Comments
 (0)