Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 6b7c4d1c

Přidáno uživatelem Martin Sebela před více než 3 roky(ů)

Re #8163 - CSS, JS refactoring

Zobrazit rozdíly:

website/public/js/zcu-heatmap.js
328 328
}
329 329

  
330 330
const getPaginationButtonsInPopup = (currentPage, countPages) => ({
331
  previousButton: '<button id="btn-previous-page" class="circle-button" onclick="setPreviousPageInPopup()"></button>',
332
  pagesList: `<div id="pages">${currentPage} z ${countPages}</div>`,
333
  nextButton: '<button id="btn-next-page" class="circle-button next" onclick="setNextPageInPopup()"></button>'
331
  previousButton: '<button type="button" id="btn-popup-previous-page" onclick="setPreviousPageInPopup()"></button>',
332
  pagesList: `<p id="pages">${currentPage} z ${countPages}</p>`,
333
  nextButton: '<button type="button" id="btn-popup-next-page" class="next" onclick="setNextPageInPopup()"></button>'
334 334
})
335 335

  
336 336
const disablePopupPaginationButtons = () => {
337
  $('#btn-previous-page').prop('disabled', true)
338
  $('#btn-next-page').prop('disabled', true)
339
  $('.popup-controls').hide()
337
  $('#btn-popup-previous-page').prop('disabled', true)
338
  $('#btn-popup-next-page').prop('disabled', true)
339
  $('.popup-pagination').hide()
340 340
}
341 341

  
342 342
const generatePopupPaginationButtons = (controls) => {
343
  return `<div class="popup-controls">${controls ? controls.reduce((sum, item) => sum + item, '') : ''}</div>`
343
  return `<div class="popup-pagination">${controls ? controls.reduce((sum, item) => sum + item, '') : ''}</div>`
344 344
}
345 345

  
346 346
const getCountPagesInPopup = () => {
......
399 399
  const popupData = `
400 400
    <div id="place-intesity">
401 401
      <span id="current-number">${currentCount}</span>
402
      <span id="part-info">${(sum && sum !== Number(currentCount)) ? '/' + sum : ''}</span>
402
      <span id="sum-number">${(sum && sum !== Number(currentCount)) ? '/' + sum : ''}</span>
403 403
    </div>`
404 404
  const { previousButton, nextButton, pagesList } = getPaginationButtonsInPopup(currentPage, countPages)
405 405

  
......
478 478

  
479 479
  if (!countDatasets) {
480 480
    if (mymap._popup) {
481
      $('#part-info').text('')
481
      $('#sum-number').text('')
482 482
      $('#current-number').html(0)
483 483
      disablePopupPaginationButtons()
484 484
    }

Také k dispozici: Unified diff