Created
January 25, 2013 18:30
-
-
Save shirashin/4636726 to your computer and use it in GitHub Desktop.
JQueryUIのダイアログ拡張
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class @Dialog | |
| yesNoDialog:(target, dialog)-> | |
| jquery_dialog = $(dialog) | |
| # ボタンの表示文字列を取得 | |
| buttons_ary = {} | |
| buttons_ary[jquery_dialog.attr("dialog_ok")] = -> | |
| $(@).dialog( "close" ) | |
| $(target).unbind("click") | |
| target.click() | |
| buttons_ary[jquery_dialog.attr("dialog_no")] = -> | |
| $(@).dialog( "close" ) | |
| # ダイアログの描画 | |
| jquery_dialog.dialog({ | |
| resizable: false, | |
| height:140, | |
| modal: true, | |
| buttons: buttons_ary | |
| }) | |
| $(($)-> | |
| $('.destroyConfirm').bind("click", -> | |
| dialog = new Dialog() | |
| dialog.yesNoDialog(@,"#destroy-confirm-dialog") | |
| false | |
| ) | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| body{ | |
| text-align : center; | |
| font-family: 'MS ゴシック', Osaka, Arial, sans-serif; | |
| font-size: 12px; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <a href="#" class="destroyConfirm">dialog test!!!</a> | |
| <div id="destroy-confirm-dialog" title="Sample" dialog_ok="YES!!" dialog_no="NO" style="display: none;"> | |
| <p style="text-align: left;"><span class="ui-icon ui-icon-alert" style="float:left;"></span>ponpocopocopoco!!!!!!!!!!!!!!!</p> | |
| </div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment