mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-03 06:59:14 +00:00
Merge spree js function and override
This commit is contained in:
@@ -81,6 +81,8 @@ jQuery(function($) {
|
||||
|
||||
$.fn.visible = function(cond) { this[cond ? 'show' : 'hide' ]() };
|
||||
|
||||
// Overriding a broken function in Spree. Bug report at
|
||||
// https://github.com/spree/spree/issues/4032
|
||||
show_flash_error = function(message) {
|
||||
error_div = $('.flash.error');
|
||||
if (error_div.length > 0) {
|
||||
@@ -90,7 +92,7 @@ show_flash_error = function(message) {
|
||||
if ($("#content .toolbar").length > 0) {
|
||||
$("#content .toolbar").before('<div class="flash error">' + message + '</div>');
|
||||
} else {
|
||||
$("#content h1").before('<div class="flash error">' + message + '</div>');
|
||||
$("#progress").before('<div class="flash error">' + message + '</div>');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user