polyglot_keys.js 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. * Copyright (c) UNA, Inc - https://una.io
  3. * MIT License - https://opensource.org/licenses/MIT
  4. *
  5. * @defgroup UnaStudio UNA Studio
  6. * @{
  7. */
  8. function BxDolStudioPolyglotKeys(oOptions) {
  9. this._iSearchTimeoutId = false;
  10. this.sActionsUrl = oOptions.sActionUrl;
  11. this.sObjNameGrid = oOptions.sObjNameGrid;
  12. this.sObjName = oOptions.sObjName == undefined ? 'oBxDolStudioPolyglotKeys' : oOptions.sObjName;
  13. this.sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'fade' : oOptions.sAnimationEffect;
  14. this.iAnimationSpeed = oOptions.iAnimationSpeed == undefined ? 'slow' : oOptions.iAnimationSpeed;
  15. this.sTextSearchInput = oOptions.sTextSearchInput == undefined ? '' : oOptions.sTextSearchInput;
  16. }
  17. BxDolStudioPolyglotKeys.prototype.onChangeFilter = function() {
  18. var $this = this;
  19. var sValueModule = $('#bx-grid-module-' + this.sObjNameGrid).val().replace('id-', '');
  20. var sValueSearch = $('#bx-grid-search-' + this.sObjNameGrid).val();
  21. if(sValueSearch == this.sTextSearchInput)
  22. sValueSearch = '';
  23. clearTimeout($this._iSearchTimeoutId);
  24. $this._iSearchTimeoutId = setTimeout(function () {
  25. glGrids[$this.sObjNameGrid].setFilter(sValueModule + '#-#' + sValueSearch, true);
  26. }, 500);
  27. };
  28. /** @} */