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

simplify the setting of button text: { okText: "foo", cancelText: "bar" ... #52

Closed
wants to merge 1 commit into from
Closed
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
Empty file modified coffee/vex.coffee
100644 → 100755
Empty file.
7 changes: 7 additions & 0 deletions coffee/vex.dialog.coffee
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ vexDialogFactory = ($, vex) ->

dialog.open = (options) ->
options = $.extend {}, vex.defaultOptions, dialog.defaultOptions, options

if options.okText and options.buttons[0] and typeof options.okText is 'string'
options.buttons[0].text = options.okText

if options.cancelText and options.buttons[1] and typeof options.cancelText is 'string'
options.buttons[1].text = options.cancelText

options.content = dialog.buildDialogForm options

options.beforeClose = ($vexContent) ->
Expand Down
2 changes: 1 addition & 1 deletion css/vex-theme-bottom-right-corner.css
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@
.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-buttons {
*zoom: 1;
}
/* line 38, ../../../../../.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */
/* line 38, ../../../../../../Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-0.12.5/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */
.vex.vex-theme-bottom-right-corner .vex-dialog-form .vex-dialog-buttons:after {
content: "";
display: table;
Expand Down
2 changes: 1 addition & 1 deletion css/vex-theme-default.css
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@
.vex.vex-theme-default .vex-dialog-form .vex-dialog-buttons {
*zoom: 1;
}
/* line 38, ../../../../../.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */
/* line 38, ../../../../../../Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-0.12.5/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */
.vex.vex-theme-default .vex-dialog-form .vex-dialog-buttons:after {
content: "";
display: table;
Expand Down
2 changes: 1 addition & 1 deletion css/vex-theme-flat-attack.css
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@
margin-left: -2em;
margin-right: -2em;
}
/* line 38, ../../../../../.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */
/* line 38, ../../../../../../Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-0.12.5/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */
.vex.vex-theme-flat-attack .vex-dialog-form .vex-dialog-buttons:after {
content: "";
display: table;
Expand Down
2 changes: 1 addition & 1 deletion css/vex-theme-os.css
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@
.vex.vex-theme-os .vex-dialog-form .vex-dialog-buttons {
*zoom: 1;
}
/* line 38, ../../../../../.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */
/* line 38, ../../../../../../Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-0.12.5/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */
.vex.vex-theme-os .vex-dialog-form .vex-dialog-buttons:after {
content: "";
display: table;
Expand Down
2 changes: 1 addition & 1 deletion css/vex-theme-plain.css
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
.vex.vex-theme-plain .vex-dialog-form .vex-dialog-buttons {
*zoom: 1;
}
/* line 38, ../../../../../.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */
/* line 38, ../../../../../../Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-0.12.5/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */
.vex.vex-theme-plain .vex-dialog-form .vex-dialog-buttons:after {
content: "";
display: table;
Expand Down
2 changes: 1 addition & 1 deletion css/vex-theme-top.css
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@
.vex.vex-theme-top .vex-dialog-form .vex-dialog-buttons {
*zoom: 1;
}
/* line 38, ../../../../../.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */
/* line 38, ../../../../../../Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-0.12.5/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */
.vex.vex-theme-top .vex-dialog-form .vex-dialog-buttons:after {
content: "";
display: table;
Expand Down
2 changes: 1 addition & 1 deletion css/vex-theme-wireframe.css
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
.vex.vex-theme-wireframe .vex-dialog-form .vex-dialog-buttons {
*zoom: 1;
}
/* line 38, ../../../../../.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */
/* line 38, ../../../../../../Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-0.12.5/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */
.vex.vex-theme-wireframe .vex-dialog-form .vex-dialog-buttons:after {
content: "";
display: table;
Expand Down
25 changes: 13 additions & 12 deletions css/vex.css
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* define the encoding, or it will raise an error like: Invalid GBK character "\xE2" */
@keyframes vex-fadein {
/* line 9, ../sass/_keyframes.sass */
0% {
Expand Down Expand Up @@ -218,14 +219,14 @@
}
}

/* line 11, ../sass/vex.sass */
/* line 14, ../sass/vex.sass */
.vex, .vex *, .vex *:before, .vex *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}

/* line 14, ../sass/vex.sass */
/* line 17, ../sass/vex.sass */
.vex {
position: fixed;
overflow: auto;
Expand All @@ -237,14 +238,14 @@
left: 0;
}

/* line 25, ../sass/vex.sass */
/* line 28, ../sass/vex.sass */
.vex-overlay {
background: black;
filter: alpha(opacity=40);
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";
}

/* line 30, ../sass/vex.sass */
/* line 33, ../sass/vex.sass */
.vex-overlay {
animation: vex-fadein 0.5s;
-webkit-animation: vex-fadein 0.5s;
Expand All @@ -259,7 +260,7 @@
bottom: 0;
left: 0;
}
/* line 39, ../sass/vex.sass */
/* line 42, ../sass/vex.sass */
.vex.vex-closing .vex-overlay {
animation: vex-fadeout 0.5s;
-webkit-animation: vex-fadeout 0.5s;
Expand All @@ -269,7 +270,7 @@
-webkit-backface-visibility: hidden;
}

/* line 42, ../sass/vex.sass */
/* line 45, ../sass/vex.sass */
.vex-content {
animation: vex-fadein 0.5s;
-webkit-animation: vex-fadein 0.5s;
Expand All @@ -279,7 +280,7 @@
-webkit-backface-visibility: hidden;
background: white;
}
/* line 46, ../sass/vex.sass */
/* line 49, ../sass/vex.sass */
.vex.vex-closing .vex-content {
animation: vex-fadeout 0.5s;
-webkit-animation: vex-fadeout 0.5s;
Expand All @@ -289,24 +290,24 @@
-webkit-backface-visibility: hidden;
}

/* line 49, ../sass/vex.sass */
/* line 52, ../sass/vex.sass */
.vex-close:before {
font-family: Arial, sans-serif;
content: "\00D7";
}

/* line 53, ../sass/vex.sass */
/* line 56, ../sass/vex.sass */
.vex-dialog-form {
margin: 0;
}

/* line 56, ../sass/vex.sass */
/* line 59, ../sass/vex.sass */
.vex-dialog-button {
-webkit-appearance: none;
cursor: pointer;
}

/* line 60, ../sass/vex.sass */
/* line 63, ../sass/vex.sass */
.vex-loading-spinner {
animation: vex-rotation 0.7s linear infinite;
-webkit-animation: vex-rotation 0.7s linear infinite;
Expand All @@ -329,7 +330,7 @@
background: white;
}

/* line 76, ../sass/vex.sass */
/* line 79, ../sass/vex.sass */
body.vex-open {
overflow: hidden;
}
4 changes: 4 additions & 0 deletions docs/landing-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,10 @@
}, 600);
}
}

$(function() {
vex.dialog.confirm({ okText: "确定", cancelText: "取消", message: "Test for just setting button text." });
});
</script>
<div class="page">
<h1>vex</h1>
Expand Down
Loading