Skip to content

Commit

Permalink
Подключаемый toolbar_click в wnd_selection, attr.db в Pouch.save_obj()
Browse files Browse the repository at this point in the history
  • Loading branch information
unpete committed Dec 2, 2016
1 parent 0089621 commit 627eb28
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 46 deletions.
12 changes: 6 additions & 6 deletions dist/metadata.core.js
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) {
Expand Down Expand Up @@ -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;

Expand All @@ -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 = {};
Expand All @@ -2831,7 +2831,7 @@ function Pouch(){
tObj._attachments[att] = tmp._attachments[att];
}
}

tmp = null;
attr = null;
return tObj;
Expand Down
4 changes: 2 additions & 2 deletions dist/metadata.core.min.js

Large diffs are not rendered by default.

23 changes: 14 additions & 9 deletions dist/metadata.js
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) {
Expand Down Expand Up @@ -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;

Expand All @@ -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 = {};
Expand All @@ -3473,7 +3473,7 @@ function Pouch(){
tObj._attachments[att] = tmp._attachments[att];
}
}

tmp = null;
attr = null;
return tObj;
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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){
Expand Down
6 changes: 3 additions & 3 deletions dist/metadata.min.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions history.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# v0.11.223

### 02.12.2016
- Подключаемый обработчик нажатия кнопок панели инструментов формы _wnd_selection_
- В атрибутах метода _Pouch.save_obj_ учтено значение _db_, что позволяет сохранить текущий объект в другой базе. Например, зарегистрировать изменения объекта с типом кеширования _ram_ на сервере

### 21.11.2016
- В конструктор _OTabular_ добавлен параметр _ts_captions_, позволяющий задать индивидуальную настроку колонок табчасти
- Исправлена ошибка _OTabular_ при работе с булевыми типами дополнительных реквизитов
Expand Down
12 changes: 6 additions & 6 deletions lib/metadata.core.js
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) {
Expand Down Expand Up @@ -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;

Expand All @@ -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 = {};
Expand All @@ -2831,7 +2831,7 @@ function Pouch(){
tObj._attachments[att] = tmp._attachments[att];
}
}

tmp = null;
attr = null;
return tObj;
Expand Down
23 changes: 14 additions & 9 deletions lib/metadata.js
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) {
Expand Down Expand Up @@ -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;

Expand All @@ -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 = {};
Expand All @@ -3473,7 +3473,7 @@ function Pouch(){
tObj._attachments[att] = tmp._attachments[att];
}
}

tmp = null;
attr = null;
return tObj;
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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){
Expand Down
6 changes: 3 additions & 3 deletions lib/metadata.min.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/pouchdb.js
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,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;

Expand All @@ -520,10 +520,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 = {};
Expand All @@ -532,7 +532,7 @@ function Pouch(){
tObj._attachments[att] = tmp._attachments[att];
}
}

tmp = null;
attr = null;
return tObj;
Expand Down
11 changes: 8 additions & 3 deletions src/widgets/wnd_selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,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);

Expand Down Expand Up @@ -368,6 +368,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();

Expand Down Expand Up @@ -643,9 +648,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){
Expand Down

0 comments on commit 627eb28

Please sign in to comment.