Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for classes in tables #455

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions simpleCart.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
Copyright (c) 2012 Brett Wejrowski
Copyright (c) 2014 Brett Wejrowski

wojodesign.com
simplecartjs.org
http://github.com/wojodesign/simplecart-js

VERSION 3.0.5
VERSION 3.1.0

Dual licensed under the MIT or GPL licenses.
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~*/
Expand Down Expand Up @@ -87,11 +87,12 @@

// default options
settings = {
checkout : { type: "PayPal", email: "[email protected]" },
currency : "USD",
language : "english-us",
checkout : { type: "PayPal", email: "[email protected]" },
currency : "USD",
language : "english-us",

cartStyle : "div",
cartStyle : "div",
cartStyleClasses : null,
cartColumns : [
{ attr: "name", label: "Name" },
{ attr: "price", label: "Price", view: 'currency' },
Expand Down Expand Up @@ -622,11 +623,12 @@
writeCart: function (selector) {
var TABLE = settings.cartStyle.toLowerCase(),
isTable = TABLE === 'table',
CLASSES = settings.cartStyleClasses,
TR = isTable ? "tr" : "div",
TH = isTable ? 'th' : 'div',
TD = isTable ? 'td' : 'div',
THEAD = isTable ? 'thead' : 'div',
cart_container = simpleCart.$create(TABLE),
cart_container = CLASSES != null ? simpleCart.$create(TABLE).addClass(CLASSES) : simpleCart.$create(TABLE),
thead_container = simpleCart.$create(THEAD),
header_container = simpleCart.$create(TR).addClass('headerRow'),
container = simpleCart.$(selector),
Expand Down
Loading