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