mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-12-25 04:33:50 +01:00
trigger event when dialog is shown to perform custom dialog actions
This commit is contained in:
parent
71b9357a9f
commit
7c31954b19
@ -37,6 +37,12 @@ BootstrapDialog.Request = new Class({
|
|||||||
});
|
});
|
||||||
me.show();
|
me.show();
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
onDialogShown: function() {
|
||||||
|
if (typeof(onDialogShown) == "function") {
|
||||||
|
onDialogShown();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ var BootstrapDialog = new Class({
|
|||||||
content.append(footer);
|
content.append(footer);
|
||||||
}
|
}
|
||||||
this._native.find(".modal-dialog").append(content);
|
this._native.find(".modal-dialog").append(content);
|
||||||
|
this._native.on('shown.bs.modal', this.onDialogShown);
|
||||||
},
|
},
|
||||||
|
|
||||||
_buildFooter: function() {
|
_buildFooter: function() {
|
||||||
@ -78,7 +79,9 @@ var BootstrapDialog = new Class({
|
|||||||
//this method should be abstract
|
//this method should be abstract
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onDialogShown: function() {
|
||||||
|
|
||||||
|
},
|
||||||
onRemoveClick: function(event) {
|
onRemoveClick: function(event) {
|
||||||
event.data.model.setValue(null);
|
event.data.model.setValue(null);
|
||||||
event.data.dialog.close();
|
event.data.dialog.close();
|
||||||
|
@ -51,7 +51,7 @@ mindplot.widget.LinkEditor = new Class({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Add Input
|
// Add Input
|
||||||
var input = $('<input/>').attr({
|
var input = $('<input id="inputUrl"/>').attr({
|
||||||
'placeholder': 'http://www.example.com/',
|
'placeholder': 'http://www.example.com/',
|
||||||
'required': 'true',
|
'required': 'true',
|
||||||
'autofocus': 'autofocus',
|
'autofocus': 'autofocus',
|
||||||
@ -116,6 +116,10 @@ mindplot.widget.LinkEditor = new Class({
|
|||||||
if (!this.formSubmitted) {
|
if (!this.formSubmitted) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onDialogShown: function() {
|
||||||
|
$(this).find('#inputUrl').focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -44,10 +44,9 @@ mindplot.widget.NoteEditor = new Class({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Add textarea
|
// Add textarea
|
||||||
var textArea = $('<textarea></textarea>').attr({
|
var textArea = $('<textarea></textarea autofocus>').attr({
|
||||||
'placeholder':$msg('WRITE_YOUR_TEXT_HERE'),
|
'placeholder':$msg('WRITE_YOUR_TEXT_HERE'),
|
||||||
'required':'true',
|
'required':'true',
|
||||||
'autofocus':'autofocus',
|
|
||||||
'class':'form-control'
|
'class':'form-control'
|
||||||
});
|
});
|
||||||
textArea.css({
|
textArea.css({
|
||||||
@ -82,6 +81,10 @@ mindplot.widget.NoteEditor = new Class({
|
|||||||
|
|
||||||
onAcceptClick: function() {
|
onAcceptClick: function() {
|
||||||
$("#noteFormId").submit();
|
$("#noteFormId").submit();
|
||||||
|
},
|
||||||
|
|
||||||
|
onDialogShown: function() {
|
||||||
|
$(this).find('textarea').focus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@
|
|||||||
|
|
||||||
<p><strong><spring:message code="ADD_PEOPLE"/>:</strong></p>
|
<p><strong><spring:message code="ADD_PEOPLE"/>:</strong></p>
|
||||||
|
|
||||||
<input type="text" id="collabEmails" name="collabEmails" class="form-control"
|
<input type="text" id="collabEmails" name="collabEmails" class="form-control" autofocus='autofocus'
|
||||||
placeholder="<spring:message code="COLLABORATORS_SEPARATED_BY_COMA"/>"/>
|
placeholder="<spring:message code="COLLABORATORS_SEPARATED_BY_COMA"/>"/>
|
||||||
|
|
||||||
<div class="btn-group" id="roleBtn">
|
<div class="btn-group" id="roleBtn">
|
||||||
@ -113,6 +113,10 @@ $("#collabEmails").keyup(function(event) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function onDialogShown() {
|
||||||
|
$('#collabEmails').focus();
|
||||||
|
}
|
||||||
|
|
||||||
var messages = {
|
var messages = {
|
||||||
owner:'<spring:message code="IS_OWNER"/>',
|
owner:'<spring:message code="IS_OWNER"/>',
|
||||||
editor:'<spring:message code="CAN_EDIT"/>',
|
editor:'<spring:message code="CAN_EDIT"/>',
|
||||||
|
Loading…
Reference in New Issue
Block a user