mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
wip: UI refactoring
* Ajax 302 catcher is working * Fixed little issue in the autocompleter plugin see #204
This commit is contained in:
@@ -70,10 +70,13 @@
|
||||
},
|
||||
|
||||
select_entry: function(evt) {
|
||||
var $link;
|
||||
if (evt != undefined) {
|
||||
evt.preventDefault();
|
||||
$link = $(evt.target);
|
||||
} else {
|
||||
$link = this.$menu.find('.active > a');
|
||||
}
|
||||
var $link = this.$menu.find('.active > a');
|
||||
var curvalue = this.$element.attr("value");
|
||||
|
||||
this.$element.attr("value", curvalue.substr(
|
||||
|
||||
+4
-3
@@ -206,17 +206,18 @@ function simple_ajax_request(e) {
|
||||
* Simple function that redirect ajax requests to the login page if
|
||||
* the status code received with a response is equal to 278.
|
||||
*/
|
||||
function ajax_login_redirect() {
|
||||
if (this.status != 278) {
|
||||
function ajax_login_redirect(xhr) {
|
||||
if (xhr.status != 278) {
|
||||
return;
|
||||
}
|
||||
var params = "?next=" + window.location.pathname;
|
||||
|
||||
window.location.href =
|
||||
this.xhr.getResponseHeader("Location").replace(/\?.*$/, params);
|
||||
xhr.getResponseHeader("Location").replace(/\?.*$/, params);
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$(document).ajaxSuccess(function(e, xhr, settings) { ajax_login_redirect(xhr); });
|
||||
$(document).on('click', 'a[data-toggle="ajaxmodal"]', modalbox);
|
||||
$(document).on('click', 'a[data-toggle="ajaxmodal-autowidth"]', modalbox_autowidth);
|
||||
});
|
||||
Reference in New Issue
Block a user