BootstrapDialog 응용 프로그램
6104 단어 Web
var newBootstrapDialog = BootstrapDialog.show({
title:'dialog ',
type:BootstrapDialog.TYPE_DEFAULT,
message:' ',
animate:false,
draggable: true,
autodestroy:true,
closeByBackdrop: false,
onshown: function(dialogRef){},
onhidden: function(dialogRef){},
buttons:[{
label:' ',
cssClass:'btn-default',
action:function(dialogRef){}
}]
});
function addDialog(divId,title,msg,buttons,size,dialogOnHidden,dialogOnShown,position) {
var newBootstrapDialog = BootstrapDialog.show({
title:title,
type:BootstrapDialog.TYPE_DEFAULT ,
message: msg,
animate:false,
draggable: true,
autodestroy:true,
closeByBackdrop: false,
onshown: function(dialogRef){
dialogRef.getModalHeader().css("padding",4);
dialogRef.getModalFooter().css("padding",8);
dialogRef.getModalDialog().on('mousedown', function(event) {
var src = event.target || window.event.srcElement;
if(src.tagName === "INPUT" || src.tagName === "TEXTAREA" || src.tagName === "SELECT" ||src.tagName === "CHECKBOX"||src.tagName === "RADIO"||src.tagName === "BUTTON"){
return;
}
if(src.tagName === "DIV"){
if($(src).css('overflow') !== 'visible') return;
}
var dialog = dialogRef;
dialog.draggableData.isMouseDown = true;
var dialogOffset = dialog.getModalContent().offset();
dialog.draggableData.mouseOffset = {
top: event.clientY - dialogOffset.top,
left: event.clientX - dialogOffset.left
};
});
var offsetHorizontal = 0;
if(position){
offsetHorizontal = position;
}
if(size){
dialogRef.getModalDialog().css("width",size[0]);
dialogRef.getModalContent().css("height",size[1]);
dialogRef.getModalDialog().css("height",size[1]);
}
dialogRef.getModalDialog().css("top",(document.documentElement.clientHeight-dialogRef.getModalDialog().height())/2+offsetHorizontal);
if(dialogOnShown){
dialogOnShown();
}
if($("#"+divId)[0]){
$("#"+divId)[0].dialogObj=dialogRef;
}
},
onhidden: function(dialogRef){
if(dialogOnHidden){
dialogOnHidden();
}
},
buttons:buttons
});
return newBootstrapDialog;
}
function addCloseConfirm(message,windowId){
var buttons=[{label: $('#confirmOkBtn').val(),
cssClass: 'btn-primary',
action: function(dialogRef){
dialogRef.close();
if (windowId) {
closeDialog(windowId);
}
}},{label: $('#confirmCancelBtn').val(),
cssClass: 'btn-default',
action: function(dialogRef){
dialogRef.close();
}}
];
var dialog=addDialog("colseConfirmDialog",null,message,buttons,[400],null,null);
dialog.getModalHeader().hide();
}
function addSubmitConfirm(message,doOkMethod,submit,refresh,doCancelMethod){
if (typeof(submit) === "undefined") {
submit = true;
}
if (typeof(refresh) === "undefined") {
refresh = true;
}
var buttons=[{label: $('#confirmYesBtn').val(),
cssClass: 'btn-primary',
action: function(dialogRef){
if (!submitLock) {
if (doOkMethod) {
doOkMethod();
}
if (submit) {
submitLock = true;
}
}
if (!refresh) {
submitLock = false;
dialogRef.close();
}
}},{label: $('#confirmNoBtn').val(),
cssClass: 'btn-default',
action: function(dialogRef){
if (doCancelMethod) {
doCancelMethod();
}
dialogRef.close();
}}
];
var dialog=addDialog("submitConfirmDialog",null,message,buttons,[425],null,null);
dialog.getModalHeader().hide();
}
function addWindow(divId,title,url,size,dialogOnHidden,dialogOnShown,position){
var html = $.ajax({
url: url,
async: false
}).responseText;
var msg=$("<div id="+divId+"></div>").append(html);
var buttons=[];
var newBootstrapDialog = addDialog(divId,title,msg,buttons,size,dialogOnHidden,dialogOnShown,position);
return newBootstrapDialog;
}
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Fortinet FortiWeb Web Application Firewall Policy BypassFrom: Geffrey Velasquez Date: Wed, 2 May 2012 20:33:23 -0500...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.