@@ -84,7 +84,9 @@ var DesignerOfflineDB = (function () {
8484 }
8585 } ;
8686
87- request . onerror = designerDB . onerror ;
87+ request . onerror = function ( ) {
88+ Functions . ajaxShowMessage ( Messages . strIndexedDBNotWorking , null , 'error' ) ;
89+ } ;
8890 } ;
8991
9092 /**
@@ -94,6 +96,11 @@ var DesignerOfflineDB = (function () {
9496 * @return {void }
9597 */
9698 designerDB . loadObject = function ( table , id , callback ) {
99+ if ( datastore === null ) {
100+ Functions . ajaxShowMessage ( Messages . strIndexedDBNotWorking , null , 'error' ) ;
101+ return ;
102+ }
103+
97104 var objStore = designerDB . getObjectStore ( table ) ;
98105 var cursorRequest = objStore . get ( parseInt ( id ) ) ;
99106
@@ -110,6 +117,11 @@ var DesignerOfflineDB = (function () {
110117 * @return {void }
111118 */
112119 designerDB . loadAllObjects = function ( table , callback ) {
120+ if ( datastore === null ) {
121+ Functions . ajaxShowMessage ( Messages . strIndexedDBNotWorking , null , 'error' ) ;
122+ return ;
123+ }
124+
113125 var transaction = designerDB . getTransaction ( table ) ;
114126 var cursorRequest = designerDB . getCursorRequest ( transaction , table ) ;
115127 var results = [ ] ;
@@ -136,6 +148,11 @@ var DesignerOfflineDB = (function () {
136148 * @return {void }
137149 */
138150 designerDB . loadFirstObject = function ( table , callback ) {
151+ if ( datastore === null ) {
152+ Functions . ajaxShowMessage ( Messages . strIndexedDBNotWorking , null , 'error' ) ;
153+ return ;
154+ }
155+
139156 var transaction = designerDB . getTransaction ( table ) ;
140157 var cursorRequest = designerDB . getCursorRequest ( transaction , table ) ;
141158 var firstResult = null ;
@@ -162,6 +179,11 @@ var DesignerOfflineDB = (function () {
162179 * @return {void }
163180 */
164181 designerDB . addObject = function ( table , obj , callback ) {
182+ if ( datastore === null ) {
183+ Functions . ajaxShowMessage ( Messages . strIndexedDBNotWorking , null , 'error' ) ;
184+ return ;
185+ }
186+
165187 var objStore = designerDB . getObjectStore ( table ) ;
166188 var request = objStore . put ( obj ) ;
167189
@@ -181,6 +203,11 @@ var DesignerOfflineDB = (function () {
181203 * @return {void }
182204 */
183205 designerDB . deleteObject = function ( table , id , callback ) {
206+ if ( datastore === null ) {
207+ Functions . ajaxShowMessage ( Messages . strIndexedDBNotWorking , null , 'error' ) ;
208+ return ;
209+ }
210+
184211 var objStore = designerDB . getObjectStore ( table ) ;
185212 var request = objStore . delete ( parseInt ( id ) ) ;
186213
0 commit comments