Created
March 8, 2017 16:39
-
-
Save helloGoGo/c0acc8140b15e5fe35f9eea9136d0f02 to your computer and use it in GitHub Desktop.
ダイアログの表示制御を行う共通オブジェクト
This file contains 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
/** | |
* ダイアログの表示制御を行う共通オブジェクト | |
*/ | |
var CommonDialog = { | |
/** | |
* 表示対象のダイアログIDを格納する | |
* @type {string} | |
*/ | |
dialogId : '', | |
/** | |
* ダイアログ設定の初期化を行う | |
* @param {object} opt 個別設定 | |
*/ | |
init : function(opt) { | |
this.dialogId = opt.id; | |
var dialogOpt = { | |
modal: true, | |
autoOpen: false, | |
draggable: true, | |
position: { my: "center", at: "center", of: window }, | |
}; | |
for (var name in opt) { | |
dialogOpt[name] = opt[name]; | |
} | |
$(this.dialogId).dialog(dialogOpt); | |
}, | |
/** | |
* ダイアログを表示する | |
*/ | |
open : function() { | |
$(this.dialogId).dialog('open'); | |
}, | |
/** | |
* ダイアログを非表示にする | |
*/ | |
close : function() { | |
$(this.dialogId).dialog('close'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment