Changeset 204 for Dev/branches/Cartis/js
- Timestamp:
- 01/05/12 17:19:14 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/Cartis/js/dashboardScripts.js
r202 r204 105 105 function removeFromList(event) { 106 106 if (event == null || event == undefined) return; 107 107 108 var id = event.target.parentNode.id; 108 109 var uid = id.split("shoppingCartItem")[1]; 109 110 // find index, remove from object 110 111 var indexInCart = shoppingCart.contents.uids.indexOf(uid); 112 var tempTitle = shoppingCart.contents.titles[indexInCart]; 113 var cn = confirm("Are you sure you want to remove: "+tempTitle+"?"); 114 if (cn == false) return; 115 116 111 117 shoppingCart.contents.uids.splice(indexInCart, 1); 112 118 var title = shoppingCart.contents.titles.splice(indexInCart, 1)[0]; … … 114 120 //Then replace element back into relevant list 115 121 // First set element 122 116 123 var element; 117 124 switch (type){ … … 161 168 currentlySelected.type = null; 162 169 } 170 171 function configureDashboard() { 172 var data = JSON.stringify(shoppingCart); 173 var form = ce("form"); 174 form.action = "DProbeersel.php"; 175 form.method = "POST"; 176 var input = ce("input"); 177 input.type = "hidden"; 178 input.name = "selectedData"; 179 input.value = data; 180 form.appendChild(input); 181 form.submit(); 182 }
Note: See TracChangeset
for help on using the changeset viewer.