X-Git-Url: https://scm.cri.mines-paristech.fr/git/Portfolio.git/blobdiff_plain/011a53d5681ad1f5fa88a534ec041c93d3e7be95..bf33c9ca85d7668e07e0a98d7af0be131d665b31:/skins/cart_listing.js diff --git a/skins/cart_listing.js b/skins/cart_listing.js index cd7e908..cf160c3 100644 --- a/skins/cart_listing.js +++ b/skins/cart_listing.js @@ -1,10 +1,7 @@ /* -* © 2009 Luxia SAS. All rights reserved. -* Contributors -* — Benoît Pin -* -* $Id: cart_listing.js 1009 2009-05-17 15:18:05Z pin $ -* $URL: http://svn.luxia.fr/svn/labo/projects/zope/Portfolio/trunk/skins/cart_listing.js $ +* 2009 Benoit Pin - MINES ParisTech +* http://plinn.org +* Licence GPL */ var CartListing; @@ -12,39 +9,39 @@ var CartListing; (function(){ var ENTERKEY = 13; -CartListing = function(table) { +CartListing = function(table) { var thisCL = this; this.table = table; var form = table.parentNode; - while(form.tagName != 'FORM') - form = form.parentNode; + while(form.tagName !== 'FORM') { + form = form.parentNode;} this.fm = new FormManager(form); - if (browser.isIE) - addListener(table, 'focusout', function(evt){thisCL.updateRow(evt);}); - else - addListener(table, 'change', function(evt){thisCL.updateRow(evt);}); + if (browser.isIE){ + addListener(table, 'focusout', function(evt){thisCL.updateRow(evt);});} + else{ + addListener(table, 'change', function(evt){thisCL.updateRow(evt);});} addListener(table, 'keypress', function(evt){thisCL.onKeypress(evt);}); -} +}; CartListing.prototype.updateRow = function(evt) { var target = getTargetedObject(evt); - if (target.tagName != 'INPUT') - return; + if (target.tagName !== 'INPUT'){ + return;} var row = target.parentNode.parentNode; - var inputs = row.getElementsByTagName('input') + var inputs = row.getElementsByTagName('input'); var refreshBtn = inputs[1]; this.fm.submitButton = refreshBtn; this.fm.submit(evt); }; CartListing.prototype.onKeypress = function(evt){ - if (evt.keyCode == ENTERKEY) - this.updateRow(evt); + if (evt.keyCode === ENTERKEY){ + this.updateRow(evt);} }; -})(); \ No newline at end of file +}());