tryton-sao 7.8.0 → 7.8.1

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/CHANGELOG CHANGED
@@ -1,4 +1,9 @@
1
1
 
2
+ Version 7.8.1 - 2025-12-20
3
+ --------------------------
4
+ * Bug fixes (see mercurial logs for details)
5
+
6
+
2
7
  Version 7.8.0 - 2025-12-15
3
8
  --------------------------
4
9
  * Bug fixes (see mercurial logs for details)
@@ -357,6 +357,9 @@ var Sao = {
357
357
  return lang.replace('_', '-');
358
358
  };
359
359
  Sao.i18n.set_direction = function(direction) {
360
+ if (!direction) {
361
+ direction = getComputedStyle(document.documentElement).direction;
362
+ }
360
363
  Sao.i18n.rtl = (direction === 'rtl');
361
364
  jQuery('html').attr('dir', direction);
362
365
  };
@@ -590,6 +593,7 @@ var Sao = {
590
593
  Sao.login = function() {
591
594
  Sao.set_title();
592
595
  Sao.i18n.setlang().always(function() {
596
+ Sao.i18n.set_direction();
593
597
  Sao.Session.server_version()
594
598
  .then(function(version) {
595
599
  if (JSON.stringify(version.split('.').slice(0, 2)) !==
@@ -614,8 +618,7 @@ var Sao = {
614
618
  let user_id = Sao.Session.current_session.user_id;
615
619
  Sao.Bus.register(
616
620
  `notification:${user_id}`,
617
- Sao.NotificationMenu.notify
618
- .bind(Sao.NotificationMenu));
621
+ Sao.NotificationMenu.notify);
619
622
  Sao.NotificationMenu.count();
620
623
  Sao.Bus.listen();
621
624
 
@@ -642,7 +645,7 @@ var Sao = {
642
645
  jQuery('#menu').empty();
643
646
  let user_id = Sao.Session.current_session.user_id;
644
647
  Sao.Bus.unregister(
645
- `notification:${user_id}`, Sao.NotificationMenu.update);
648
+ `notification:${user_id}`, Sao.NotificationMenu.notify);
646
649
  session.do_logout().always(Sao.login);
647
650
  Sao.set_title();
648
651
  });
@@ -12173,9 +12176,11 @@ var Sao = {
12173
12176
  if (chat.length) {
12174
12177
  chat.remove();
12175
12178
  } else {
12176
- this._chat = new Sao.Chat(this.screen.current_reference);
12177
- this._chat.refresh();
12178
- this.sidebar_content.append(this._chat.el);
12179
+ if (this.screen.current_reference) {
12180
+ this._chat = new Sao.Chat(this.screen.current_reference);
12181
+ this._chat.refresh();
12182
+ this.sidebar_content.append(this._chat.el);
12183
+ }
12179
12184
  }
12180
12185
  this.update_sidebar();
12181
12186
  },
@@ -12310,6 +12315,9 @@ var Sao = {
12310
12315
  const view_type = this.screen.current_view.view_type;
12311
12316
  var next_view_type = this.screen.next_view_type;
12312
12317
  const has_views = this.screen.number_of_views > 1;
12318
+ let sensitive = (
12319
+ record_id >= 0 ? record_id !== null && record_id !== undefined :
12320
+ false);
12313
12321
  var buttons = ['print', 'relate', 'email', 'attach', 'chat'];
12314
12322
  for (const button_id of buttons) {
12315
12323
  const button = this.buttons[button_id];
@@ -12329,10 +12337,10 @@ var Sao = {
12329
12337
  return keyword == button_id;
12330
12338
  });
12331
12339
  }
12332
- set_sensitive(button_id, position && can_be_sensitive);
12340
+ set_sensitive(button_id, sensitive && can_be_sensitive);
12333
12341
  }
12334
12342
  for (let button_id of ['reload', 'action']) {
12335
- set_sensitive(button_id, record_id !== null);
12343
+ set_sensitive(button_id, sensitive);
12336
12344
  }
12337
12345
  set_sensitive(
12338
12346
  'switch_',
@@ -12368,6 +12376,7 @@ var Sao = {
12368
12376
  this._chat.refresh();
12369
12377
  this.sidebar_content.append(this._chat.el);
12370
12378
  }
12379
+ this.update_sidebar();
12371
12380
  }
12372
12381
  },
12373
12382
  record_modified: function() {
@@ -29407,8 +29416,9 @@ function eval_pyson(value){
29407
29416
 
29408
29417
  class _Chat {
29409
29418
  constructor(record) {
29419
+ this.notify = this.notify.bind(this);
29410
29420
  this.record = record;
29411
- Sao.Bus.register(`chat:${this.record}`, this.notify.bind(this));
29421
+ Sao.Bus.register(`chat:${this.record}`, this.notify);
29412
29422
  this.el = this.__build();
29413
29423
  }
29414
29424
 
@@ -29611,6 +29621,7 @@ function eval_pyson(value){
29611
29621
 
29612
29622
  class _NotificationMenu {
29613
29623
  constructor() {
29624
+ this.notify = this.notify.bind(this);
29614
29625
  this.el = jQuery('<ul/>', {
29615
29626
  'class': 'notification-menu dropdown-menu',
29616
29627
  'role': 'menu',
@@ -29645,9 +29656,11 @@ function eval_pyson(value){
29645
29656
  }).append(jQuery('<span/>', {
29646
29657
  'class': 'notification-label',
29647
29658
  'text': notification.label,
29659
+ 'title': notification.label,
29648
29660
  })).append(jQuery('<span/>', {
29649
29661
  'class': 'notification-description',
29650
- 'text': notification.description
29662
+ 'text': notification.description,
29663
+ 'title': notification.description,
29651
29664
  }));
29652
29665
  let link = jQuery('<a/>', {
29653
29666
  'role': 'menuitem',
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "tryton-sao",
3
3
  "title": "sao",
4
4
  "description": "Tryton webclient",
5
- "version": "7.8.0",
5
+ "version": "7.8.1",
6
6
  "homepage": "https://www.tryton.org/",
7
7
  "author": {
8
8
  "name": "Tryton"
package/src/chat.js CHANGED
@@ -5,8 +5,9 @@
5
5
 
6
6
  class _Chat {
7
7
  constructor(record) {
8
+ this.notify = this.notify.bind(this);
8
9
  this.record = record;
9
- Sao.Bus.register(`chat:${this.record}`, this.notify.bind(this));
10
+ Sao.Bus.register(`chat:${this.record}`, this.notify);
10
11
  this.el = this.__build();
11
12
  }
12
13
 
@@ -6,6 +6,7 @@
6
6
 
7
7
  class _NotificationMenu {
8
8
  constructor() {
9
+ this.notify = this.notify.bind(this);
9
10
  this.el = jQuery('<ul/>', {
10
11
  'class': 'notification-menu dropdown-menu',
11
12
  'role': 'menu',
@@ -40,9 +41,11 @@
40
41
  }).append(jQuery('<span/>', {
41
42
  'class': 'notification-label',
42
43
  'text': notification.label,
44
+ 'title': notification.label,
43
45
  })).append(jQuery('<span/>', {
44
46
  'class': 'notification-description',
45
- 'text': notification.description
47
+ 'text': notification.description,
48
+ 'title': notification.description,
46
49
  }));
47
50
  let link = jQuery('<a/>', {
48
51
  'role': 'menuitem',
package/src/sao.js CHANGED
@@ -357,6 +357,9 @@ var Sao = {
357
357
  return lang.replace('_', '-');
358
358
  };
359
359
  Sao.i18n.set_direction = function(direction) {
360
+ if (!direction) {
361
+ direction = getComputedStyle(document.documentElement).direction;
362
+ }
360
363
  Sao.i18n.rtl = (direction === 'rtl');
361
364
  jQuery('html').attr('dir', direction);
362
365
  };
@@ -590,6 +593,7 @@ var Sao = {
590
593
  Sao.login = function() {
591
594
  Sao.set_title();
592
595
  Sao.i18n.setlang().always(function() {
596
+ Sao.i18n.set_direction();
593
597
  Sao.Session.server_version()
594
598
  .then(function(version) {
595
599
  if (JSON.stringify(version.split('.').slice(0, 2)) !==
@@ -614,8 +618,7 @@ var Sao = {
614
618
  let user_id = Sao.Session.current_session.user_id;
615
619
  Sao.Bus.register(
616
620
  `notification:${user_id}`,
617
- Sao.NotificationMenu.notify
618
- .bind(Sao.NotificationMenu));
621
+ Sao.NotificationMenu.notify);
619
622
  Sao.NotificationMenu.count();
620
623
  Sao.Bus.listen();
621
624
 
@@ -642,7 +645,7 @@ var Sao = {
642
645
  jQuery('#menu').empty();
643
646
  let user_id = Sao.Session.current_session.user_id;
644
647
  Sao.Bus.unregister(
645
- `notification:${user_id}`, Sao.NotificationMenu.update);
648
+ `notification:${user_id}`, Sao.NotificationMenu.notify);
646
649
  session.do_logout().always(Sao.login);
647
650
  Sao.set_title();
648
651
  });
package/src/tab.js CHANGED
@@ -1406,9 +1406,11 @@
1406
1406
  if (chat.length) {
1407
1407
  chat.remove();
1408
1408
  } else {
1409
- this._chat = new Sao.Chat(this.screen.current_reference);
1410
- this._chat.refresh();
1411
- this.sidebar_content.append(this._chat.el);
1409
+ if (this.screen.current_reference) {
1410
+ this._chat = new Sao.Chat(this.screen.current_reference);
1411
+ this._chat.refresh();
1412
+ this.sidebar_content.append(this._chat.el);
1413
+ }
1412
1414
  }
1413
1415
  this.update_sidebar();
1414
1416
  },
@@ -1543,6 +1545,9 @@
1543
1545
  const view_type = this.screen.current_view.view_type;
1544
1546
  var next_view_type = this.screen.next_view_type;
1545
1547
  const has_views = this.screen.number_of_views > 1;
1548
+ let sensitive = (
1549
+ record_id >= 0 ? record_id !== null && record_id !== undefined :
1550
+ false);
1546
1551
  var buttons = ['print', 'relate', 'email', 'attach', 'chat'];
1547
1552
  for (const button_id of buttons) {
1548
1553
  const button = this.buttons[button_id];
@@ -1562,10 +1567,10 @@
1562
1567
  return keyword == button_id;
1563
1568
  });
1564
1569
  }
1565
- set_sensitive(button_id, position && can_be_sensitive);
1570
+ set_sensitive(button_id, sensitive && can_be_sensitive);
1566
1571
  }
1567
1572
  for (let button_id of ['reload', 'action']) {
1568
- set_sensitive(button_id, record_id !== null);
1573
+ set_sensitive(button_id, sensitive);
1569
1574
  }
1570
1575
  set_sensitive(
1571
1576
  'switch_',
@@ -1601,6 +1606,7 @@
1601
1606
  this._chat.refresh();
1602
1607
  this.sidebar_content.append(this._chat.el);
1603
1608
  }
1609
+ this.update_sidebar();
1604
1610
  }
1605
1611
  },
1606
1612
  record_modified: function() {