listBody.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
  1. const subManager = new SubsManager();
  2. const InfiniteScrollIter = 10;
  3. BlazeComponent.extendComponent({
  4. onCreated() {
  5. // for infinite scrolling
  6. this.cardlimit = new ReactiveVar(InfiniteScrollIter);
  7. },
  8. onRendered() {
  9. const domElement = this.find('.js-perfect-scrollbar');
  10. this.$(domElement).on('scroll', () => this.updateList(domElement));
  11. $(window).on(`resize.${this.data().listId}`, () => this.updateList(domElement));
  12. // we add a Mutation Observer to allow propagations of cardlimit
  13. // when the spinner stays in the current view (infinite scrolling)
  14. this.mutationObserver = new MutationObserver(() => this.updateList(domElement));
  15. this.mutationObserver.observe(domElement, {
  16. childList: true,
  17. });
  18. this.updateList(domElement);
  19. },
  20. onDestroyed() {
  21. $(window).off(`resize.${this.data().listId}`);
  22. this.mutationObserver.disconnect();
  23. },
  24. mixins() {
  25. return [Mixins.PerfectScrollbar];
  26. },
  27. openForm(options) {
  28. options = options || {};
  29. options.position = options.position || 'top';
  30. const forms = this.childComponents('inlinedForm');
  31. let form = forms.find((component) => {
  32. return component.data().position === options.position;
  33. });
  34. if (!form && forms.length > 0) {
  35. form = forms[0];
  36. }
  37. form.open();
  38. },
  39. addCard(evt) {
  40. evt.preventDefault();
  41. const firstCardDom = this.find('.js-minicard:first');
  42. const lastCardDom = this.find('.js-minicard:last');
  43. const textarea = $(evt.currentTarget).find('textarea');
  44. const position = this.currentData().position;
  45. const title = textarea.val().trim();
  46. const formComponent = this.childComponents('addCardForm')[0];
  47. let sortIndex;
  48. if (position === 'top') {
  49. sortIndex = Utils.calculateIndex(null, firstCardDom).base;
  50. } else if (position === 'bottom') {
  51. sortIndex = Utils.calculateIndex(lastCardDom, null).base;
  52. }
  53. const members = formComponent.members.get();
  54. const labelIds = formComponent.labels.get();
  55. const customFields = formComponent.customFields.get();
  56. const board = this.data().board();
  57. let linkedId = '';
  58. let swimlaneId = '';
  59. const boardView = Meteor.user().profile.boardView;
  60. let cardType = 'cardType-card';
  61. if (title) {
  62. if (board.isTemplatesBoard()) {
  63. swimlaneId = this.parentComponent().parentComponent().data()._id; // Always swimlanes view
  64. const swimlane = Swimlanes.findOne(swimlaneId);
  65. // If this is the card templates swimlane, insert a card template
  66. if (swimlane.isCardTemplatesSwimlane())
  67. cardType = 'template-card';
  68. // If this is the board templates swimlane, insert a board template and a linked card
  69. else if (swimlane.isBoardTemplatesSwimlane()) {
  70. linkedId = Boards.insert({
  71. title,
  72. permission: 'private',
  73. type: 'template-board',
  74. });
  75. Swimlanes.insert({
  76. title: TAPi18n.__('default'),
  77. boardId: linkedId,
  78. });
  79. cardType = 'cardType-linkedBoard';
  80. }
  81. } else if (boardView === 'board-view-swimlanes')
  82. swimlaneId = this.parentComponent().parentComponent().data()._id;
  83. else if ((boardView === 'board-view-lists') || (boardView === 'board-view-cal'))
  84. swimlaneId = board.getDefaultSwimline()._id;
  85. const _id = Cards.insert({
  86. title,
  87. members,
  88. labelIds,
  89. customFields,
  90. listId: this.data()._id,
  91. boardId: board._id,
  92. sort: sortIndex,
  93. swimlaneId,
  94. type: cardType,
  95. linkedId,
  96. });
  97. // if the displayed card count is less than the total cards in the list,
  98. // we need to increment the displayed card count to prevent the spinner
  99. // to appear
  100. const cardCount = this.data().cards(this.idOrNull(swimlaneId)).count();
  101. if (this.cardlimit.get() < cardCount) {
  102. this.cardlimit.set(this.cardlimit.get() + InfiniteScrollIter);
  103. }
  104. // In case the filter is active we need to add the newly inserted card in
  105. // the list of exceptions -- cards that are not filtered. Otherwise the
  106. // card will disappear instantly.
  107. // See https://github.com/wekan/wekan/issues/80
  108. Filter.addException(_id);
  109. // We keep the form opened, empty it, and scroll to it.
  110. textarea.val('').focus();
  111. autosize.update(textarea);
  112. if (position === 'bottom') {
  113. this.scrollToBottom();
  114. }
  115. formComponent.reset();
  116. }
  117. },
  118. scrollToBottom() {
  119. const container = this.firstNode();
  120. $(container).animate({
  121. scrollTop: container.scrollHeight,
  122. });
  123. },
  124. clickOnMiniCard(evt) {
  125. if (MultiSelection.isActive() || evt.shiftKey) {
  126. evt.stopImmediatePropagation();
  127. evt.preventDefault();
  128. const methodName = evt.shiftKey ? 'toggleRange' : 'toggle';
  129. MultiSelection[methodName](this.currentData()._id);
  130. // If the card is already selected, we want to de-select it.
  131. // XXX We should probably modify the minicard href attribute instead of
  132. // overwriting the event in case the card is already selected.
  133. } else if (Session.equals('currentCard', this.currentData()._id)) {
  134. evt.stopImmediatePropagation();
  135. evt.preventDefault();
  136. Utils.goBoardId(Session.get('currentBoard'));
  137. }
  138. },
  139. cardIsSelected() {
  140. return Session.equals('currentCard', this.currentData()._id);
  141. },
  142. toggleMultiSelection(evt) {
  143. evt.stopPropagation();
  144. evt.preventDefault();
  145. MultiSelection.toggle(this.currentData()._id);
  146. },
  147. idOrNull(swimlaneId) {
  148. const currentUser = Meteor.user();
  149. if (currentUser.profile.boardView === 'board-view-swimlanes' ||
  150. this.data().board().isTemplatesBoard())
  151. return swimlaneId;
  152. return undefined;
  153. },
  154. cardsWithLimit(swimlaneId) {
  155. const limit = this.cardlimit.get();
  156. const selector = {
  157. listId: this.currentData()._id,
  158. archived: false,
  159. };
  160. if (swimlaneId)
  161. selector.swimlaneId = swimlaneId;
  162. return Cards.find(Filter.mongoSelector(selector), {
  163. sort: ['sort'],
  164. limit,
  165. });
  166. },
  167. spinnerInView(container) {
  168. const parentViewHeight = container.clientHeight;
  169. const bottomViewPosition = container.scrollTop + parentViewHeight;
  170. const spinner = this.find('.sk-spinner-list');
  171. const threshold = spinner.offsetTop;
  172. return bottomViewPosition > threshold;
  173. },
  174. showSpinner(swimlaneId) {
  175. const list = Template.currentData();
  176. return list.cards(swimlaneId).count() > this.cardlimit.get();
  177. },
  178. updateList(container) {
  179. // first, if the spinner is not rendered, we have reached the end of
  180. // the list of cards, so skip and disable firing the events
  181. const target = this.find('.sk-spinner-list');
  182. if (!target) {
  183. this.$(container).off('scroll');
  184. $(window).off(`resize.${this.data().listId}`);
  185. return;
  186. }
  187. if (this.spinnerInView(container)) {
  188. this.cardlimit.set(this.cardlimit.get() + InfiniteScrollIter);
  189. Ps.update(container);
  190. }
  191. },
  192. canSeeAddCard() {
  193. return !this.reachedWipLimit() && Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
  194. },
  195. reachedWipLimit() {
  196. const list = Template.currentData();
  197. return !list.getWipLimit('soft') && list.getWipLimit('enabled') && list.getWipLimit('value') <= list.cards().count();
  198. },
  199. events() {
  200. return [{
  201. 'click .js-minicard': this.clickOnMiniCard,
  202. 'click .js-toggle-multi-selection': this.toggleMultiSelection,
  203. 'click .open-minicard-composer': this.scrollToBottom,
  204. submit: this.addCard,
  205. }];
  206. },
  207. }).register('listBody');
  208. function toggleValueInReactiveArray(reactiveValue, value) {
  209. const array = reactiveValue.get();
  210. const valueIndex = array.indexOf(value);
  211. if (valueIndex === -1) {
  212. array.push(value);
  213. } else {
  214. array.splice(valueIndex, 1);
  215. }
  216. reactiveValue.set(array);
  217. }
  218. BlazeComponent.extendComponent({
  219. onCreated() {
  220. this.labels = new ReactiveVar([]);
  221. this.members = new ReactiveVar([]);
  222. this.customFields = new ReactiveVar([]);
  223. const currentBoardId = Session.get('currentBoard');
  224. arr = [];
  225. _.forEach(Boards.findOne(currentBoardId).customFields().fetch(), function(field){
  226. if(field.automaticallyOnCard)
  227. arr.push({_id: field._id, value: null});
  228. });
  229. this.customFields.set(arr);
  230. },
  231. reset() {
  232. this.labels.set([]);
  233. this.members.set([]);
  234. this.customFields.set([]);
  235. },
  236. getLabels() {
  237. const currentBoardId = Session.get('currentBoard');
  238. return Boards.findOne(currentBoardId).labels.filter((label) => {
  239. return this.labels.get().indexOf(label._id) > -1;
  240. });
  241. },
  242. pressKey(evt) {
  243. // Pressing Enter should submit the card
  244. if (evt.keyCode === 13 && !evt.shiftKey) {
  245. evt.preventDefault();
  246. const $form = $(evt.currentTarget).closest('form');
  247. // XXX For some reason $form.submit() does not work (it's probably a bug
  248. // of blaze-component related to the fact that the submit event is non-
  249. // bubbling). This is why we click on the submit button instead -- which
  250. // work.
  251. $form.find('button[type=submit]').click();
  252. // Pressing Tab should open the form of the next column, and Maj+Tab go
  253. // in the reverse order
  254. } else if (evt.keyCode === 9) {
  255. evt.preventDefault();
  256. const isReverse = evt.shiftKey;
  257. const list = $(`#js-list-${this.data().listId}`);
  258. const listSelector = '.js-list:not(.js-list-composer)';
  259. let nextList = list[isReverse ? 'prev' : 'next'](listSelector).get(0);
  260. // If there is no next list, loop back to the beginning.
  261. if (!nextList) {
  262. nextList = $(listSelector + (isReverse ? ':last' : ':first')).get(0);
  263. }
  264. BlazeComponent.getComponentForElement(nextList).openForm({
  265. position:this.data().position,
  266. });
  267. }
  268. },
  269. events() {
  270. return [{
  271. keydown: this.pressKey,
  272. 'click .js-link': Popup.open('linkCard'),
  273. 'click .js-search': Popup.open('searchElement'),
  274. 'click .js-card-template': Popup.open('searchElement'),
  275. }];
  276. },
  277. onRendered() {
  278. const editor = this;
  279. const $textarea = this.$('textarea');
  280. autosize($textarea);
  281. $textarea.escapeableTextComplete([
  282. // User mentions
  283. {
  284. match: /\B@([\w.]*)$/,
  285. search(term, callback) {
  286. const currentBoard = Boards.findOne(Session.get('currentBoard'));
  287. callback($.map(currentBoard.activeMembers(), (member) => {
  288. const user = Users.findOne(member.userId);
  289. return user.username.indexOf(term) === 0 ? user : null;
  290. }));
  291. },
  292. template(user) {
  293. return user.username;
  294. },
  295. replace(user) {
  296. toggleValueInReactiveArray(editor.members, user._id);
  297. return '';
  298. },
  299. index: 1,
  300. },
  301. // Labels
  302. {
  303. match: /\B#(\w*)$/,
  304. search(term, callback) {
  305. const currentBoard = Boards.findOne(Session.get('currentBoard'));
  306. callback($.map(currentBoard.labels, (label) => {
  307. if (label.name.indexOf(term) > -1 ||
  308. label.color.indexOf(term) > -1) {
  309. return label;
  310. }
  311. return null;
  312. }));
  313. },
  314. template(label) {
  315. return Blaze.toHTMLWithData(Template.autocompleteLabelLine, {
  316. hasNoName: !label.name,
  317. colorName: label.color,
  318. labelName: label.name || label.color,
  319. });
  320. },
  321. replace(label) {
  322. toggleValueInReactiveArray(editor.labels, label._id);
  323. return '';
  324. },
  325. index: 1,
  326. },
  327. ], {
  328. // When the autocomplete menu is shown we want both a press of both `Tab`
  329. // or `Enter` to validation the auto-completion. We also need to stop the
  330. // event propagation to prevent the card from submitting (on `Enter`) or
  331. // going on the next column (on `Tab`).
  332. onKeydown(evt, commands) {
  333. if (evt.keyCode === 9 || evt.keyCode === 13) {
  334. evt.stopPropagation();
  335. return commands.KEY_ENTER;
  336. }
  337. return null;
  338. },
  339. });
  340. },
  341. }).register('addCardForm');
  342. BlazeComponent.extendComponent({
  343. onCreated() {
  344. this.selectedBoardId = new ReactiveVar('');
  345. this.selectedSwimlaneId = new ReactiveVar('');
  346. this.selectedListId = new ReactiveVar('');
  347. this.boardId = Session.get('currentBoard');
  348. // In order to get current board info
  349. subManager.subscribe('board', this.boardId);
  350. this.board = Boards.findOne(this.boardId);
  351. // List where to insert card
  352. const list = $(Popup._getTopStack().openerElement).closest('.js-list');
  353. this.listId = Blaze.getData(list[0])._id;
  354. // Swimlane where to insert card
  355. const swimlane = $(Popup._getTopStack().openerElement).closest('.js-swimlane');
  356. this.swimlaneId = '';
  357. const boardView = Meteor.user().profile.boardView;
  358. if (boardView === 'board-view-swimlanes')
  359. this.swimlaneId = Blaze.getData(swimlane[0])._id;
  360. else if (boardView === 'board-view-lists')
  361. this.swimlaneId = Swimlanes.findOne({boardId: this.boardId})._id;
  362. },
  363. boards() {
  364. const boards = Boards.find({
  365. archived: false,
  366. 'members.userId': Meteor.userId(),
  367. _id: {$ne: Session.get('currentBoard')},
  368. type: 'board',
  369. }, {
  370. sort: ['title'],
  371. });
  372. return boards;
  373. },
  374. swimlanes() {
  375. if (!this.selectedBoardId.get()) {
  376. return [];
  377. }
  378. const swimlanes = Swimlanes.find({boardId: this.selectedBoardId.get()});
  379. if (swimlanes.count())
  380. this.selectedSwimlaneId.set(swimlanes.fetch()[0]._id);
  381. return swimlanes;
  382. },
  383. lists() {
  384. if (!this.selectedBoardId.get()) {
  385. return [];
  386. }
  387. const lists = Lists.find({boardId: this.selectedBoardId.get()});
  388. if (lists.count())
  389. this.selectedListId.set(lists.fetch()[0]._id);
  390. return lists;
  391. },
  392. cards() {
  393. if (!this.board) {
  394. return [];
  395. }
  396. const ownCardsIds = this.board.cards().map((card) => { return card.linkedId || card._id; });
  397. return Cards.find({
  398. boardId: this.selectedBoardId.get(),
  399. swimlaneId: this.selectedSwimlaneId.get(),
  400. listId: this.selectedListId.get(),
  401. archived: false,
  402. linkedId: {$nin: ownCardsIds},
  403. _id: {$nin: ownCardsIds},
  404. type: {$nin: ['template-card']},
  405. });
  406. },
  407. events() {
  408. return [{
  409. 'change .js-select-boards'(evt) {
  410. subManager.subscribe('board', $(evt.currentTarget).val());
  411. this.selectedBoardId.set($(evt.currentTarget).val());
  412. },
  413. 'change .js-select-swimlanes'(evt) {
  414. this.selectedSwimlaneId.set($(evt.currentTarget).val());
  415. },
  416. 'change .js-select-lists'(evt) {
  417. this.selectedListId.set($(evt.currentTarget).val());
  418. },
  419. 'click .js-done' (evt) {
  420. // LINK CARD
  421. evt.stopPropagation();
  422. evt.preventDefault();
  423. const linkedId = $('.js-select-cards option:selected').val();
  424. if (!linkedId) {
  425. Popup.close();
  426. return;
  427. }
  428. const _id = Cards.insert({
  429. title: $('.js-select-cards option:selected').text(), //dummy
  430. listId: this.listId,
  431. swimlaneId: this.swimlaneId,
  432. boardId: this.boardId,
  433. sort: Lists.findOne(this.listId).cards().count(),
  434. type: 'cardType-linkedCard',
  435. linkedId,
  436. });
  437. Filter.addException(_id);
  438. Popup.close();
  439. },
  440. 'click .js-link-board' (evt) {
  441. //LINK BOARD
  442. evt.stopPropagation();
  443. evt.preventDefault();
  444. const impBoardId = $('.js-select-boards option:selected').val();
  445. if (!impBoardId || Cards.findOne({linkedId: impBoardId, archived: false})) {
  446. Popup.close();
  447. return;
  448. }
  449. const _id = Cards.insert({
  450. title: $('.js-select-boards option:selected').text(), //dummy
  451. listId: this.listId,
  452. swimlaneId: this.swimlaneId,
  453. boardId: this.boardId,
  454. sort: Lists.findOne(this.listId).cards().count(),
  455. type: 'cardType-linkedBoard',
  456. linkedId: impBoardId,
  457. });
  458. Filter.addException(_id);
  459. Popup.close();
  460. },
  461. }];
  462. },
  463. }).register('linkCardPopup');
  464. BlazeComponent.extendComponent({
  465. mixins() {
  466. return [Mixins.PerfectScrollbar];
  467. },
  468. onCreated() {
  469. this.isCardTemplateSearch = $(Popup._getTopStack().openerElement).hasClass('js-card-template');
  470. this.isListTemplateSearch = $(Popup._getTopStack().openerElement).hasClass('js-list-template');
  471. this.isSwimlaneTemplateSearch = $(Popup._getTopStack().openerElement).hasClass('js-open-add-swimlane-menu');
  472. this.isBoardTemplateSearch = $(Popup._getTopStack().openerElement).hasClass('js-add-board');
  473. this.isTemplateSearch = this.isCardTemplateSearch ||
  474. this.isListTemplateSearch ||
  475. this.isSwimlaneTemplateSearch ||
  476. this.isBoardTemplateSearch;
  477. let board = {};
  478. if (this.isTemplateSearch) {
  479. board = Boards.findOne(Meteor.user().profile.templatesBoardId);
  480. } else {
  481. // Prefetch first non-current board id
  482. board = Boards.findOne({
  483. archived: false,
  484. 'members.userId': Meteor.userId(),
  485. _id: {$nin: [Session.get('currentBoard'), Meteor.user().profile.templatesBoardId]},
  486. });
  487. }
  488. if (!board) {
  489. Popup.close();
  490. return;
  491. }
  492. const boardId = board._id;
  493. // Subscribe to this board
  494. subManager.subscribe('board', boardId);
  495. this.selectedBoardId = new ReactiveVar(boardId);
  496. if (!this.isBoardTemplateSearch) {
  497. this.boardId = Session.get('currentBoard');
  498. // In order to get current board info
  499. subManager.subscribe('board', this.boardId);
  500. this.swimlaneId = '';
  501. // Swimlane where to insert card
  502. const swimlane = $(Popup._getTopStack().openerElement).parents('.js-swimlane');
  503. if (Meteor.user().profile.boardView === 'board-view-swimlanes')
  504. this.swimlaneId = Blaze.getData(swimlane[0])._id;
  505. else
  506. this.swimlaneId = Swimlanes.findOne({boardId: this.boardId})._id;
  507. // List where to insert card
  508. const list = $(Popup._getTopStack().openerElement).closest('.js-list');
  509. this.listId = Blaze.getData(list[0])._id;
  510. }
  511. this.term = new ReactiveVar('');
  512. },
  513. boards() {
  514. const boards = Boards.find({
  515. archived: false,
  516. 'members.userId': Meteor.userId(),
  517. _id: {$ne: Session.get('currentBoard')},
  518. type: 'board',
  519. }, {
  520. sort: ['title'],
  521. });
  522. return boards;
  523. },
  524. results() {
  525. if (!this.selectedBoardId) {
  526. return [];
  527. }
  528. const board = Boards.findOne(this.selectedBoardId.get());
  529. if (!this.isTemplateSearch || this.isCardTemplateSearch) {
  530. return board.searchCards(this.term.get(), false);
  531. } else if (this.isListTemplateSearch) {
  532. return board.searchLists(this.term.get());
  533. } else if (this.isSwimlaneTemplateSearch) {
  534. return board.searchSwimlanes(this.term.get());
  535. } else if (this.isBoardTemplateSearch) {
  536. const boards = board.searchBoards(this.term.get());
  537. boards.forEach((board) => {
  538. subManager.subscribe('board', board.linkedId);
  539. });
  540. return boards;
  541. } else {
  542. return [];
  543. }
  544. },
  545. events() {
  546. return [{
  547. 'change .js-select-boards'(evt) {
  548. subManager.subscribe('board', $(evt.currentTarget).val());
  549. this.selectedBoardId.set($(evt.currentTarget).val());
  550. },
  551. 'submit .js-search-term-form'(evt) {
  552. evt.preventDefault();
  553. this.term.set(evt.target.searchTerm.value);
  554. },
  555. 'click .js-minicard'(evt) {
  556. // 0. Common
  557. const element = Blaze.getData(evt.currentTarget);
  558. let _id = '';
  559. if (!this.isTemplateSearch || this.isCardTemplateSearch) {
  560. // Card insertion
  561. // 1. Common
  562. element.boardId = this.boardId;
  563. element.listId = this.listId;
  564. element.swimlaneId = this.swimlaneId;
  565. element.sort = Lists.findOne(this.listId).cards().count();
  566. // 1.A From template
  567. if (this.isTemplateSearch) {
  568. element.type = 'cardType-card';
  569. element.linkedId = '';
  570. _id = element.copy();
  571. // 1.B Linked card
  572. } else {
  573. delete element._id;
  574. element.type = 'cardType-linkedCard';
  575. element.linkedId = element.linkedId || element._id;
  576. _id = Cards.insert(element);
  577. }
  578. Filter.addException(_id);
  579. // List insertion
  580. } else if (this.isListTemplateSearch) {
  581. element.boardId = this.boardId;
  582. element.sort = Swimlanes.findOne(this.swimlaneId).lists().count();
  583. element.type = 'list';
  584. _id = element.copy(this.swimlaneId);
  585. } else if (this.isSwimlaneTemplateSearch) {
  586. element.boardId = this.boardId;
  587. element.sort = Boards.findOne(this.boardId).swimlanes().count();
  588. element.type = 'swimlalne';
  589. _id = element.copy();
  590. } else if (this.isBoardTemplateSearch) {
  591. board = Boards.findOne(element.linkedId);
  592. board.sort = Boards.find({archived: false}).count();
  593. board.type = 'board';
  594. delete board.slug;
  595. delete board.members;
  596. _id = board.copy();
  597. }
  598. Popup.close();
  599. },
  600. }];
  601. },
  602. }).register('searchElementPopup');