Skip to content

Commit 6138592

Browse files
committed
Made fixes for Firefox
1 parent ca4295a commit 6138592

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

jSQL.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,7 +1665,8 @@
16651665
// Insert a group of rows
16661666
self.insert = function(model, data, successCallback) {
16671667
if(typeof successCallback !== "function") successCallback = function(){};
1668-
var transaction = self.db.transaction([model], IDBTransaction.READ_WRITE || 'readwrite');
1668+
var transParam = undefined === IDBTransaction ? 'readwrite' : IDBTransaction.READ_WRITE;
1669+
var transaction = self.db.transaction([model], transParam);
16691670
var store, i, request;
16701671
var total = data.length;
16711672

@@ -1687,8 +1688,9 @@
16871688

16881689
// Delete all items from the database
16891690
self.delete = function(model, successCallback) {
1690-
if(typeof successCallback != "function") successCallback = function(){};
1691-
var transaction = self.db.transaction([model], IDBTransaction.READ_WRITE || 'readwrite'), store, request;
1691+
var transParam = undefined === IDBTransaction ? 'readwrite' : IDBTransaction.READ_WRITE;
1692+
if(typeof successCallback !== "function") successCallback = function(){};
1693+
var transaction = self.db.transaction([model], transParam), store, request;
16921694
transaction.onerror = function(){ throw "Could not initiate a transaction"; };;
16931695
store = transaction.objectStore(model);
16941696
request = store.clear();
@@ -1699,7 +1701,8 @@
16991701
// Get all data from the datastore
17001702
self.select = function(model, successCallback) {
17011703
if("function" !== typeof successCallback) successCallback = function(){};
1702-
var transaction = self.db.transaction([model], IDBTransaction.READ_ONLY || 'readonly'), store, request, results = [];
1704+
var transParam = undefined === IDBTransaction ? 'readwrite' : IDBTransaction.READ_WRITE;
1705+
var transaction = self.db.transaction([model], transParam), store, request, results = [];
17031706
transaction.onerror = function(){ throw "Could not initiate a transaction"; };;
17041707
store = transaction.objectStore(model);
17051708
request = store.openCursor();

0 commit comments

Comments
 (0)