updated drupal core to 7.51
This commit is contained in:
@@ -476,7 +476,7 @@ Drupal.ajax.prototype.getEffect = function (response) {
|
||||
* Handler for the form redirection error.
|
||||
*/
|
||||
Drupal.ajax.prototype.error = function (xmlhttprequest, uri, customMessage) {
|
||||
alert(Drupal.ajaxError(xmlhttprequest, uri, customMessage));
|
||||
Drupal.displayAjaxError(Drupal.ajaxError(xmlhttprequest, uri, customMessage));
|
||||
// Remove the progress element.
|
||||
if (this.progress.element) {
|
||||
$(this.progress.element).remove();
|
||||
|
@@ -310,7 +310,7 @@ Drupal.ACDB.prototype.search = function (searchString) {
|
||||
}
|
||||
},
|
||||
error: function (xmlhttp) {
|
||||
alert(Drupal.ajaxError(xmlhttp, db.uri));
|
||||
Drupal.displayAjaxError(Drupal.ajaxError(xmlhttp, db.uri));
|
||||
}
|
||||
});
|
||||
}, this.delay);
|
||||
|
@@ -413,6 +413,29 @@ Drupal.getSelection = function (element) {
|
||||
return { 'start': element.selectionStart, 'end': element.selectionEnd };
|
||||
};
|
||||
|
||||
/**
|
||||
* Add a global variable which determines if the window is being unloaded.
|
||||
*
|
||||
* This is primarily used by Drupal.displayAjaxError().
|
||||
*/
|
||||
Drupal.beforeUnloadCalled = false;
|
||||
$(window).bind('beforeunload pagehide', function () {
|
||||
Drupal.beforeUnloadCalled = true;
|
||||
});
|
||||
|
||||
/**
|
||||
* Displays a JavaScript error from an Ajax response when appropriate to do so.
|
||||
*/
|
||||
Drupal.displayAjaxError = function (message) {
|
||||
// Skip displaying the message if the user deliberately aborted (for example,
|
||||
// by reloading the page or navigating to a different page) while the Ajax
|
||||
// request was still ongoing. See, for example, the discussion at
|
||||
// http://stackoverflow.com/questions/699941/handle-ajax-error-when-a-user-clicks-refresh.
|
||||
if (!Drupal.beforeUnloadCalled) {
|
||||
alert(message);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Build an error message from an Ajax response.
|
||||
*/
|
||||
|
@@ -106,8 +106,10 @@ Drupal.tableDrag = function (table, tableSettings) {
|
||||
|
||||
// Add mouse bindings to the document. The self variable is passed along
|
||||
// as event handlers do not have direct access to the tableDrag object.
|
||||
$(document).bind('mousemove', function (event) { return self.dragRow(event, self); });
|
||||
$(document).bind('mouseup', function (event) { return self.dropRow(event, self); });
|
||||
$(document).bind('mousemove pointermove', function (event) { return self.dragRow(event, self); });
|
||||
$(document).bind('mouseup pointerup', function (event) { return self.dropRow(event, self); });
|
||||
$(document).bind('touchmove', function (event) { return self.dragRow(event.originalEvent.touches[0], self); });
|
||||
$(document).bind('touchend', function (event) { return self.dropRow(event.originalEvent.touches[0], self); });
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -274,7 +276,10 @@ Drupal.tableDrag.prototype.makeDraggable = function (item) {
|
||||
});
|
||||
|
||||
// Add the mousedown action for the handle.
|
||||
handle.mousedown(function (event) {
|
||||
handle.bind('mousedown touchstart pointerdown', function (event) {
|
||||
if (event.originalEvent.type == "touchstart") {
|
||||
event = event.originalEvent.touches[0];
|
||||
}
|
||||
// Create a new dragObject recording the event information.
|
||||
self.dragObject = {};
|
||||
self.dragObject.initMouseOffset = self.getMouseOffset(item, event);
|
||||
|
Reference in New Issue
Block a user