isobit-ui 0.0.421 → 0.0.425
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* isobit-ui v0.0.
|
|
2
|
+
* isobit-ui v0.0.425
|
|
3
3
|
* (c) Erik Alarcon Pinedo
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -5885,9 +5885,11 @@ window.ui = _$1.ui = function (cfg) {
|
|
|
5885
5885
|
var action = f.action;
|
|
5886
5886
|
if (!action) action = window.location.pathname;
|
|
5887
5887
|
var t = me.$children[0].$children[0];
|
|
5888
|
-
var
|
|
5889
|
-
|
|
5890
|
-
if (
|
|
5888
|
+
var selected = me.getSelected()[0];
|
|
5889
|
+
var id = selected[t.rowKey];
|
|
5890
|
+
if (selected.tmpId) id = -selected.tmpId;
|
|
5891
|
+
console.log(selected);
|
|
5892
|
+
if (me.getSelectedId) id = me.getSelectedId(selected);
|
|
5891
5893
|
|
|
5892
5894
|
if (window.app) {
|
|
5893
5895
|
me.open(action + '/' + id + '/edit');
|
|
@@ -6256,26 +6258,22 @@ window.ui = _$1.ui = function (cfg) {
|
|
|
6256
6258
|
|
|
6257
6259
|
return _await(me.getStoredList(store), function (storedList) {
|
|
6258
6260
|
if (!storedList) storedList = [];
|
|
6259
|
-
console.log(1111111);
|
|
6260
6261
|
|
|
6261
6262
|
if (o.id) {
|
|
6262
6263
|
for (var k = 0; k < storedList.length; k++) {
|
|
6263
6264
|
if (storedList[k].tmpId == o.tmpId) {
|
|
6264
6265
|
delete o.tmpSynchronized;
|
|
6265
6266
|
storedList[k] = o;
|
|
6266
|
-
return;
|
|
6267
6267
|
}
|
|
6268
6268
|
}
|
|
6269
6269
|
}
|
|
6270
6270
|
|
|
6271
|
-
console.log(22222);
|
|
6272
6271
|
var db = window._.db;
|
|
6273
6272
|
var objectStore = db.transaction([store], "readwrite").objectStore(store);
|
|
6274
|
-
console.log('!o.id=' + !o.id);
|
|
6275
6273
|
|
|
6276
6274
|
if (!o.id) {
|
|
6277
|
-
o.
|
|
6278
|
-
o.
|
|
6275
|
+
o.tmpId = 1 * new Date();
|
|
6276
|
+
o.id = -o.tmpId; //add new item to start to array
|
|
6279
6277
|
|
|
6280
6278
|
storedList.unshift(o);
|
|
6281
6279
|
objectStore.add(o);
|
|
@@ -6324,13 +6322,15 @@ window.ui = _$1.ui = function (cfg) {
|
|
|
6324
6322
|
var objectStore = window._.db.transaction([store], "readwrite").objectStore(store);
|
|
6325
6323
|
|
|
6326
6324
|
var item = objectStore.get(o.tmpId);
|
|
6327
|
-
o.tmpSynchronized = 1;
|
|
6328
6325
|
|
|
6329
6326
|
if (data.id) {
|
|
6330
6327
|
o.id = data.id;
|
|
6331
6328
|
o0.id = o.id;
|
|
6332
6329
|
}
|
|
6333
6330
|
|
|
6331
|
+
o0.tmpSynchronized = 1;
|
|
6332
|
+
console.log(o0);
|
|
6333
|
+
|
|
6334
6334
|
item.onsuccess = function () {
|
|
6335
6335
|
if (item.result) {
|
|
6336
6336
|
objectStore.put(o);
|