display a message when a combination does not exist
This commit is contained in:
committed by
Julien Chanseaume
parent
bd5dd4a172
commit
d105879fa1
@@ -36,6 +36,7 @@ var pseManager = (function($){
|
||||
"ref": $("#pse-ref"),
|
||||
"ean": $("#pse-ean"),
|
||||
"availability": $("#pse-availability"),
|
||||
"validity": $("#pse-validity"),
|
||||
"quantity": $("#quantity"),
|
||||
"promo": $("#pse-promo"),
|
||||
"new": $("#pse-new"),
|
||||
@@ -105,8 +106,10 @@ var pseManager = (function($){
|
||||
|
||||
if ( ! pseId ) {
|
||||
// not exists, revert
|
||||
displayNotice();
|
||||
setPseForm();
|
||||
} else {
|
||||
$pse.validity.hide();
|
||||
$pse.id.val(pseId);
|
||||
$pse.pseId = pseId;
|
||||
}
|
||||
@@ -116,6 +119,15 @@ var pseManager = (function($){
|
||||
updateProductUI();
|
||||
}
|
||||
|
||||
function displayNotice() {
|
||||
var $validity = $pse.validity;
|
||||
$validity.show('fast', function(){
|
||||
setTimeout(function(){
|
||||
$validity.hide('fast');
|
||||
}, 3000);
|
||||
});
|
||||
}
|
||||
|
||||
function updateProductUI() {
|
||||
var pse = PSE[$pse.pseId],
|
||||
name = [],
|
||||
|
||||
Reference in New Issue
Block a user