Welcome to mirror list, hosted at ThFree Co, Russian Federation.

balsamiq_viewer.js « blob « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 062577af38571f2f30302ca7fd7350cc02686ffb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import Flash from '../flash';
import BalsamiqViewer from './balsamiq/balsamiq_viewer';

function onError() {
  const flash = new Flash('Balsamiq file could not be loaded.');

  return flash;
}

function loadBalsamiqFile() {
  const viewer = document.getElementById('js-balsamiq-viewer');

  if (!(viewer instanceof Element)) return;

  const endpoint = viewer.dataset.endpoint;

  const balsamiqViewer = new BalsamiqViewer(viewer);
  balsamiqViewer.loadFile(endpoint).catch(onError);
}

$(loadBalsamiqFile);