-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Подключаемый toolbar_click в wnd_selection, attr.db в Pouch.save_obj()
- Loading branch information
Showing
10 changed files
with
65 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/*! | ||
metadata.js v0.11.223, built:2016-11-30 © Evgeniy Malyarov http://www.oknosoft.ru 2014-2016 | ||
metadata.js v0.11.223, built:2016-12-02 © Evgeniy Malyarov http://www.oknosoft.ru 2014-2016 | ||
metadata.js may be freely distributed under the AGPL-3.0. To obtain _Oknosoft Commercial license_, contact [email protected] | ||
*/ | ||
(function(root, factory) { | ||
|
@@ -2791,8 +2791,8 @@ function Pouch(){ | |
value: function (tObj, attr) { | ||
|
||
var tmp = tObj._obj._clone(), | ||
db = tObj._manager.pouch_db; | ||
db = attr.db || tObj._manager.pouch_db; | ||
|
||
tmp._id = tObj._manager.class_name + "|" + tObj.ref; | ||
delete tmp.ref; | ||
|
||
|
@@ -2819,10 +2819,10 @@ function Pouch(){ | |
return db.put(tmp); | ||
}) | ||
.then(function () { | ||
|
||
if(tObj.is_new()) | ||
tObj._set_loaded(tObj.ref); | ||
|
||
if(tmp._attachments){ | ||
if(!tObj._attachments) | ||
tObj._attachments = {}; | ||
|
@@ -2831,7 +2831,7 @@ function Pouch(){ | |
tObj._attachments[att] = tmp._attachments[att]; | ||
} | ||
} | ||
|
||
tmp = null; | ||
attr = null; | ||
return tObj; | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/*! | ||
metadata.js v0.11.223, built:2016-11-30 © Evgeniy Malyarov http://www.oknosoft.ru 2014-2016 | ||
metadata.js v0.11.223, built:2016-12-02 © Evgeniy Malyarov http://www.oknosoft.ru 2014-2016 | ||
metadata.js may be freely distributed under the AGPL-3.0. To obtain _Oknosoft Commercial license_, contact [email protected] | ||
*/ | ||
(function(root, factory) { | ||
|
@@ -3433,8 +3433,8 @@ function Pouch(){ | |
value: function (tObj, attr) { | ||
|
||
var tmp = tObj._obj._clone(), | ||
db = tObj._manager.pouch_db; | ||
db = attr.db || tObj._manager.pouch_db; | ||
|
||
tmp._id = tObj._manager.class_name + "|" + tObj.ref; | ||
delete tmp.ref; | ||
|
||
|
@@ -3461,10 +3461,10 @@ function Pouch(){ | |
return db.put(tmp); | ||
}) | ||
.then(function () { | ||
|
||
if(tObj.is_new()) | ||
tObj._set_loaded(tObj.ref); | ||
|
||
if(tmp._attachments){ | ||
if(!tObj._attachments) | ||
tObj._attachments = {}; | ||
|
@@ -3473,7 +3473,7 @@ function Pouch(){ | |
tObj._attachments[att] = tmp._attachments[att]; | ||
} | ||
} | ||
|
||
tmp = null; | ||
attr = null; | ||
return tObj; | ||
|
@@ -15379,7 +15379,7 @@ DataManager.prototype.form_selection = function(pwnd, attr){ | |
if(attr.period) tbattr.period = attr.period; | ||
wnd.elmnts.filter = new $p.iface.Toolbar_filter(tbattr); | ||
|
||
|
||
// учтём права для каждой роли на каждый объект | ||
var _acl = $p.current_acl.get_acl(_mgr.class_name); | ||
|
||
|
@@ -15622,6 +15622,11 @@ DataManager.prototype.form_selection = function(pwnd, attr){ | |
*/ | ||
function toolbar_click(btn_id){ | ||
|
||
// если внешний обработчик вернул false - выходим | ||
if(attr.toolbar_click && attr.toolbar_click(btn_id, wnd, _mgr) === false){ | ||
return; | ||
} | ||
|
||
if(btn_id=="btn_select"){ | ||
select(); | ||
|
||
|
@@ -15897,9 +15902,9 @@ DataManager.prototype.form_selection = function(pwnd, attr){ | |
wnd.elmnts.grid.reload(); | ||
return true; | ||
} | ||
|
||
/** | ||
* подписываемся на событие закрытия формы объекта, чтобы обновить список и попытаться спозиционироваться на нужной строке | ||
* подписываемся на событие закрытия формы объекта, чтобы обновить список и попытаться спозиционироваться на нужной строке | ||
*/ | ||
var _frm_close = $p.eve.attachEvent("frm_close", function (class_name, ref) { | ||
if(_mgr && _mgr.class_name == class_name && wnd && wnd.elmnts){ | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/*! | ||
metadata.js v0.11.223, built:2016-11-30 © Evgeniy Malyarov http://www.oknosoft.ru 2014-2016 | ||
metadata.js v0.11.223, built:2016-12-02 © Evgeniy Malyarov http://www.oknosoft.ru 2014-2016 | ||
metadata.js may be freely distributed under the AGPL-3.0. To obtain _Oknosoft Commercial license_, contact [email protected] | ||
*/ | ||
(function(root, factory) { | ||
|
@@ -2791,8 +2791,8 @@ function Pouch(){ | |
value: function (tObj, attr) { | ||
|
||
var tmp = tObj._obj._clone(), | ||
db = tObj._manager.pouch_db; | ||
db = attr.db || tObj._manager.pouch_db; | ||
|
||
tmp._id = tObj._manager.class_name + "|" + tObj.ref; | ||
delete tmp.ref; | ||
|
||
|
@@ -2819,10 +2819,10 @@ function Pouch(){ | |
return db.put(tmp); | ||
}) | ||
.then(function () { | ||
|
||
if(tObj.is_new()) | ||
tObj._set_loaded(tObj.ref); | ||
|
||
if(tmp._attachments){ | ||
if(!tObj._attachments) | ||
tObj._attachments = {}; | ||
|
@@ -2831,7 +2831,7 @@ function Pouch(){ | |
tObj._attachments[att] = tmp._attachments[att]; | ||
} | ||
} | ||
|
||
tmp = null; | ||
attr = null; | ||
return tObj; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/*! | ||
metadata.js v0.11.223, built:2016-11-30 © Evgeniy Malyarov http://www.oknosoft.ru 2014-2016 | ||
metadata.js v0.11.223, built:2016-12-02 © Evgeniy Malyarov http://www.oknosoft.ru 2014-2016 | ||
metadata.js may be freely distributed under the AGPL-3.0. To obtain _Oknosoft Commercial license_, contact [email protected] | ||
*/ | ||
(function(root, factory) { | ||
|
@@ -3433,8 +3433,8 @@ function Pouch(){ | |
value: function (tObj, attr) { | ||
|
||
var tmp = tObj._obj._clone(), | ||
db = tObj._manager.pouch_db; | ||
db = attr.db || tObj._manager.pouch_db; | ||
|
||
tmp._id = tObj._manager.class_name + "|" + tObj.ref; | ||
delete tmp.ref; | ||
|
||
|
@@ -3461,10 +3461,10 @@ function Pouch(){ | |
return db.put(tmp); | ||
}) | ||
.then(function () { | ||
|
||
if(tObj.is_new()) | ||
tObj._set_loaded(tObj.ref); | ||
|
||
if(tmp._attachments){ | ||
if(!tObj._attachments) | ||
tObj._attachments = {}; | ||
|
@@ -3473,7 +3473,7 @@ function Pouch(){ | |
tObj._attachments[att] = tmp._attachments[att]; | ||
} | ||
} | ||
|
||
tmp = null; | ||
attr = null; | ||
return tObj; | ||
|
@@ -15379,7 +15379,7 @@ DataManager.prototype.form_selection = function(pwnd, attr){ | |
if(attr.period) tbattr.period = attr.period; | ||
wnd.elmnts.filter = new $p.iface.Toolbar_filter(tbattr); | ||
|
||
|
||
// учтём права для каждой роли на каждый объект | ||
var _acl = $p.current_acl.get_acl(_mgr.class_name); | ||
|
||
|
@@ -15622,6 +15622,11 @@ DataManager.prototype.form_selection = function(pwnd, attr){ | |
*/ | ||
function toolbar_click(btn_id){ | ||
|
||
// если внешний обработчик вернул false - выходим | ||
if(attr.toolbar_click && attr.toolbar_click(btn_id, wnd, _mgr) === false){ | ||
return; | ||
} | ||
|
||
if(btn_id=="btn_select"){ | ||
select(); | ||
|
||
|
@@ -15897,9 +15902,9 @@ DataManager.prototype.form_selection = function(pwnd, attr){ | |
wnd.elmnts.grid.reload(); | ||
return true; | ||
} | ||
|
||
/** | ||
* подписываемся на событие закрытия формы объекта, чтобы обновить список и попытаться спозиционироваться на нужной строке | ||
* подписываемся на событие закрытия формы объекта, чтобы обновить список и попытаться спозиционироваться на нужной строке | ||
*/ | ||
var _frm_close = $p.eve.attachEvent("frm_close", function (class_name, ref) { | ||
if(_mgr && _mgr.class_name == class_name && wnd && wnd.elmnts){ | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters