How to use the meteor/jquery.$ function in meteor

To help you get started, we’ve selected a few meteor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OHIF / Viewers / legacy / LesionTracker / client / components / viewerSection / viewerSection.js View on Github external
'ohif.measurements.timepoint.changeViewType .timepoint-browser-list'(event, instance, viewType) {
        const $browserList = $(event.currentTarget);
        const $allBrowserItems = $browserList.find('.timepoint-browser-item');

        // Removes all active classes to collapse the timepoints and studies
        $allBrowserItems.removeClass('active');

        if (viewType === 'key') {
            const { timepointIds, currentTimepointId } = OHIF.viewer.data;
            timepointIds.forEach(timepointId => {
                const $browserItem = $allBrowserItems.filter(`[data-id=${timepointId}]`);
                $browserItem.find('.timepoint-item').trigger('ohif.measurements.timepoint.load');
            });

            // Show only current timepoint expanded on key timepoints tab
            const $browserItem = $allBrowserItems.filter(`[data-id=${currentTimepointId}]`);
            $browserItem.find('.timepoint-item').trigger('click');
        }
github OHIF / Viewers / Packages / ohif-viewerbase / client / lib / thumbnailDragHandlers.js View on Github external
const cloneElement = (element, targetId) => {
    // Clone the DOM element
    const clone = element.cloneNode(true);

    // Find any canvas children to clone
    const clonedCanvases = $(clone).find('canvas');
    clonedCanvases.each((canvasIndex, clonedCanvas) => {
        // Draw from the original canvas to the cloned canvas
        const context = clonedCanvas.getContext('2d');
        const thumbnailCanvas = $(element).find('canvas').get(canvasIndex);
        context.drawImage(thumbnailCanvas, 0, 0);
    });

    // Update the clone with the targetId
    clone.id = targetId;
    clone.style.visibility = 'hidden';

    return clone;
};
github OHIF / Viewers / Packages / ohif-viewerbase / client / lib / classes / ResizeViewportManager.js View on Github external
repositionStudySeriesQuickSwitch() {
        OHIF.log.info('ResizeViewportManager repositionStudySeriesQuickSwitch');

        // Stop here if viewer is not displayed
        const isViewer = Session.get('ViewerOpened');
        if (!isViewer) return;

        // Stop here if there is no one or only one viewport
        const nViewports = OHIF.viewerbase.layoutManager.viewportData.length;
        if (!nViewports || nViewports <= 1) return;

        const $viewer = $('#viewer');
        const leftSidebar = $viewer.find('.sidebar-left.sidebar-open');
        const rightSidebar = $viewer.find('.sidebar-right.sidebar-open');

        const $leftQuickSwitch = $('.quickSwitchWrapper.left');
        const $rightQuickSwitch = $('.quickSwitchWrapper.right');

        const hasLeftSidebar = leftSidebar.length > 0;
        const hasRightSidebar = rightSidebar.length > 0;

        $rightQuickSwitch.removeClass('left-sidebar-only');
        $leftQuickSwitch.removeClass('right-sidebar-only');

        let leftOffset = 0;

        if (hasLeftSidebar) {
            leftOffset = (leftSidebar.width() / $(window).width()) * 100;

            if (!hasRightSidebar) {
                $rightQuickSwitch.addClass('left-sidebar-only');
            }
github aldeed / meteor-tabular / client / main.js View on Github external
initComplete: function () {
      var options = template.tabular.options.get();
      if (options.search && options.search.onEnterOnly) {
        var replaceSearchLabel = function(newText){
          $('.dataTables_filter label').contents().filter(function() {
            return this.nodeType === 3 && this.textContent.trim().length;
          }).replaceWith(newText);
        }
        $('.dataTables_filter input')
          .unbind()
          .bind('keyup change', function (event) {
            if (!table) return;
            if (event.keyCode === 13 || this.value === '') {
              replaceSearchLabel("Search:");
              table.search(this.value).draw();
            }
            else {
              replaceSearchLabel("Search (hit enter):");
            }
          });
      }
    },
    headerCallback(headerRow) {
github OHIF / Viewers / Packages / ohif-viewerbase / client / lib / hotkeyUtils.js View on Github external
const isActiveViewportEmpty = () => {
        const activeViewport = Session.get('activeViewport') || 0;
        return $('.imageViewerViewport').eq(activeViewport).hasClass('empty');
    };
github reactioncommerce / reaction / imports / plugins / included / product-variant / client / templates / products / productDetail / productImageGallery.js View on Github external
function updateImagePriorities() {
  $(".gallery > .gallery-image")
    .toArray()
    .map((element, index) => {
      const mediaId = element.getAttribute("data-index");

      Media.update(mediaId, {
        $set: {
          "metadata.priority": index
        }
      });
    });
}
github Tesseract-MI / prostatecancer.ai / packages / pirads-measurements / client / lib / customCommands.js View on Github external
$('.imageViewerViewport').each((index, ele) => {
      let elementSpecificMeasurementData = $.extend(true, {}, measurementData);
      const imagePoint = getImagePoint(patientPoint, ele);
      const id = fiducialCounter[studyInstanceUidString]

      if (measurementData.hasOwnProperty('server')) {
          id = 'server.'.concat(measurementData.f_id);
      }

      elementSpecificMeasurementData.handles.end.x = imagePoint.x;
      elementSpecificMeasurementData.handles.end.y = imagePoint.y;
      elementSpecificMeasurementData.id = id;
      elementSpecificMeasurementData.active = false;

      if (isInBoundary(ele, elementSpecificMeasurementData.handles.end)) {
          $(ele).off('cornerstonetoolsmeasurementadded');
          cornerstoneTools.addToolState(ele, toolType, elementSpecificMeasurementData);
          cornerstone.updateImage(ele);
          bindToMeasurementAdded(ele);

          imageIds.push(cornerstone.getEnabledElement(ele).image.imageId);
      }
    });
github 4minitz / 4minitz / client / templates / globals / loading.js View on Github external
Template.loading.onRendered(function() {
    $('#loading-content').hide().delay(500).fadeIn('slow');
});
github Tesseract-MI / prostatecancer.ai / packages / tesseract-report / client / components / measurementTable / measurementTableView / measurementTableView.js View on Github external
function displayResult(fiducials, studyInstanceUid) {
    const ClinSigCounter = fiducials.filter(v => v.ClinSig).length;
    const htmlLineBreak = '<br><br><br><br><br><br><br>'

    if(!(fiducials[0])) {
      $('#feedback-section').html(htmlLineBreak + '<p class="text-bold text-center">No result available for this patient.</p>')
      return;
    }

    $('#feedback-section').html(htmlLineBreak + '<p class="text-bold text-center">Fetching data from the server...</p>')

    setTimeout(() =&gt; {
      $('#feedback-section').html(htmlLineBreak + '<p class="text-bold text-center">Adding the true results to the views...</p>')
    }, delay);

    setTimeout(() =&gt; {
      $('#feedback-section').html(htmlLineBreak + '<p class="text-bold text-center">Calculating distances...</p>')
    }, (delay * (fiducials.length)) + delay);

    setTimeout(() =&gt; {
      $('#feedback-section').html(''.concat(
          '<p class="text-bold">Annotations:</p><p>Expert radiologist indicated <span class="text-color">',
          fiducials.length.toString(),
          (fiducials.length === 1) ? '</span> suspicious area ' : ' suspicious areas ',
          'for this patient.',
          '</p><br>',
github signmeup / signmeup / imports / ui / components / settings-courses / courses-general / courses-general.js View on Github external
Template.CoursesGeneral.onRendered(() => {
  const tabId = FlowRouter.getQueryParam("tab");
  if (tabId) {
    $('a[href="#' + tabId + '"]').tab("show");
  }
});