@osovitny/anatoly 2.15.2 → 2.15.4

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.
@@ -1924,8 +1924,11 @@ class Subs {
1924
1924
  </file>
1925
1925
  */
1926
1926
  class Utils {
1927
- constructor() {
1928
- this.generateRandomInteger = (start, end) => Math.floor(Math.random() * (end - start + 1)) + start;
1927
+ static idExistsInQS() {
1928
+ let id = Utils.getValueByNameInQS("id");
1929
+ if (id)
1930
+ return true;
1931
+ return false;
1929
1932
  }
1930
1933
  static getValueByNameInQS(name) {
1931
1934
  return Utils.getValueByName(location.search, name);
@@ -1991,6 +1994,9 @@ class Utils {
1991
1994
  .replace(/-+$/, ''); // Trim - from end of text
1992
1995
  return prefix + result + postfix;
1993
1996
  }
1997
+ static generateRandom(start, end) {
1998
+ return Math.floor(Math.random() * (end - start + 1)) + start;
1999
+ }
1994
2000
  }
1995
2001
 
1996
2002
  /*
@@ -3300,8 +3306,7 @@ class BaseEditComponent extends BaseComponent {
3300
3306
  this.formSubmitted = false;
3301
3307
  }
3302
3308
  isActionAdding() {
3303
- let id = Utils.getValueByNameInQS("id");
3304
- return typeof id === "undefined" || id == "";
3309
+ return Utils.idExistsInQS();
3305
3310
  }
3306
3311
  isControlValid(name, frmGroup = null) {
3307
3312
  return !this.isControlInvalid(name, frmGroup);