Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@helloGoGo
Created March 8, 2017 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save helloGoGo/c0acc8140b15e5fe35f9eea9136d0f02 to your computer and use it in GitHub Desktop.
Save helloGoGo/c0acc8140b15e5fe35f9eea9136d0f02 to your computer and use it in GitHub Desktop.
ダイアログの表示制御を行う共通オブジェクト
/**
* ダイアログの表示制御を行う共通オブジェクト
*/
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