kopia lustrzana https://github.com/wagtail/wagtail
Replace jQuery.fn.event() shorthand with trigger if called without a method
rodzic
2803c47f08
commit
bb6ed6102e
|
@ -53,7 +53,7 @@ CODE FOR SETTING UP SPECIFIC UI WIDGETS, SUCH AS DELETE BUTTONS OR MENUS, DOES N
|
|||
|
||||
// focus first suitable input found
|
||||
var timeout = setTimeout(function() {
|
||||
$('.input input,.input textarea,.input .richtext', self.container).first().focus();
|
||||
$('.input input,.input textarea,.input .richtext', self.container).first().trigger('focus');
|
||||
}, 250);
|
||||
};
|
||||
|
||||
|
|
|
@ -180,7 +180,7 @@ $(function() {
|
|||
|
||||
$(document).on('click', '.tab-toggle', function(e) {
|
||||
e.preventDefault();
|
||||
$('.tab-nav a[href="' + $(this).attr('href') + '"]').click();
|
||||
$('.tab-nav a[href="' + $(this).attr('href') + '"]').trigger('click');
|
||||
});
|
||||
|
||||
$('.dropdown').each(function() {
|
||||
|
|
|
@ -386,7 +386,7 @@ $(function() {
|
|||
$form.on('change keyup DOMSubtreeModified', function () {
|
||||
clearTimeout(autoUpdatePreviewDataTimeout);
|
||||
autoUpdatePreviewDataTimeout = setTimeout(setPreviewData, 1000);
|
||||
}).change();
|
||||
}).trigger('change');
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -93,5 +93,5 @@ function(modal) {
|
|||
Focus on the search box when opening the modal.
|
||||
FIXME: this doesn't seem to have any effect (at least on Chrome)
|
||||
*/
|
||||
$('#id_q', modal.body).focus();
|
||||
$('#id_q', modal.body).trigger('focus');
|
||||
}
|
||||
|
|
|
@ -23,5 +23,5 @@ function(modal) {
|
|||
}
|
||||
refreshFormFields();
|
||||
|
||||
$("input[name='restriction_type']", modal.body).change(refreshFormFields);
|
||||
$("input[name='restriction_type']", modal.body).trigger('change', refreshFormFields);
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
{{ block.super }}
|
||||
<script>
|
||||
$(function(){
|
||||
$('form input[name=username]').focus();
|
||||
$('form input[name=username]').trigger('focus');
|
||||
})
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
|
@ -23,5 +23,5 @@ function(modal) {
|
|||
}
|
||||
refreshFormFields();
|
||||
|
||||
$("input[name='restriction_type']", modal.body).change(refreshFormFields);
|
||||
$("input[name='restriction_type']", modal.body).trigger('change', refreshFormFields);
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@
|
|||
|
||||
<script>
|
||||
$(function(){
|
||||
$('#page-edit-form .tab-content section.active input').first().focus();
|
||||
$('#page-edit-form .tab-content section.active input').first().trigger('focus');
|
||||
|
||||
/* Make user confirm before leaving the editor if there are unsaved changes */
|
||||
{% trans "This page has unsaved changes." as confirmation_message %}
|
||||
|
|
|
@ -83,7 +83,7 @@ function(modal) {
|
|||
$(this).data('timer', wait);
|
||||
});
|
||||
|
||||
$('#collection_chooser_collection_id').change(search);
|
||||
$('#collection_chooser_collection_id').trigger('change', search);
|
||||
|
||||
{% url 'wagtailadmin_tag_autocomplete' as autocomplete_url %}
|
||||
$('#id_tags', modal.body).tagit({
|
||||
|
|
|
@ -68,13 +68,13 @@ $(function() {
|
|||
});
|
||||
}
|
||||
|
||||
$form.change($.debounce(500, formChangeHandler));
|
||||
$form.keyup($.debounce(500, formChangeHandler));
|
||||
$form.trigger('change', $.debounce(500, formChangeHandler));
|
||||
$form.trigger('keyup', $.debounce(500, formChangeHandler));
|
||||
formChangeHandler();
|
||||
|
||||
// When the user clicks the URL, automatically select the whole thing (for easier copying)
|
||||
$result.on('click', function() {
|
||||
$(this).select();
|
||||
$(this).trigger('select');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -90,7 +90,7 @@ function(modal) {
|
|||
var wait = setTimeout(search, 200);
|
||||
$(this).data('timer', wait);
|
||||
});
|
||||
$('#collection_chooser_collection_id').change(search);
|
||||
$('#collection_chooser_collection_id').trigger('change', search);
|
||||
$('a.suggested-tag').on('click', function() {
|
||||
currentTag = $(this).text();
|
||||
$('#id_q').val('');
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function(modal) {
|
||||
function ajaxifyLinks (context) {
|
||||
|
||||
$('.listing a.choose-query', context).click(chooseQuery);
|
||||
$('.listing a.choose-query', context).trigger('click', chooseQuery);
|
||||
|
||||
$('.pagination a', context).on('click', function() {
|
||||
var page = this.getAttribute("data-page");
|
||||
|
|
Ładowanie…
Reference in New Issue