Ejemplo n.º 1
0
      .then(function (id) {
        configTemplate.close('save');

        if (id) {
          notify.info('Saved Visualization "' + savedVis.title + '"');
          if (savedVis.id === $route.current.params.id) return;
          kbnUrl.change('/visualize/edit/{{id}}', {id: savedVis.id});
        }
      }, notify.fatal);
Ejemplo n.º 2
0
      this.copyToClipboard = selector => {
        const notify = new Notifier({
          location: `Share ${$scope.objectType}`,
        });

        // Select the text to be copied. If the copy fails, the user can easily copy it manually.
        const copyTextarea = $document.find(selector)[0];
        copyTextarea.select();

        try {
          const isCopied = document.execCommand('copy');
          if (isCopied) {
            notify.info('URL copied to clipboard.');
          } else {
            notify.info('URL selected. Press Ctrl+C to copy.');
          }
        } catch (err) {
          notify.info('URL selected. Press Ctrl+C to copy.');
        }
      };