當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript jQuery.each函數代碼示例

本文整理匯總了TypeScript中jQuery.each函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript each函數的具體用法?TypeScript each怎麽用?TypeScript each使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了each函數的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: setupEvents

  /**
   * create internal objects for the given events
   */
  setupEvents(events) {
    const parts = _.partition(events, 'isRegion');
    const regions = parts[0];
    events = parts[1];

    $.each(events, (index, event) => {
      const ve = new VisualEvent(event, this._buildDiv(event));
      this._events.push(ve);
    });

    $.each(regions, (index, event) => {
      const vre = new VisualEvent(event, this._buildRegDiv(event));
      this._events.push(vre);
    });

    this._events.sort((a, b) => {
      const ao = a.getOptions(),
        bo = b.getOptions();
      if (ao.min > bo.min) {
        return 1;
      }
      if (ao.min < bo.min) {
        return -1;
      }
      return 0;
    });
  }
開發者ID:CorpGlory,項目名稱:grafana,代碼行數:30,代碼來源:jquery.flot.events.ts

示例2: populateInstanceComputableOptions

export function populateInstanceComputableOptions(options) {
  $.each(instanceComputableOptions, function(name, func) {
    if (options[name] == null) {
      options[name] = func(options)
    }
  })
}
開發者ID:caseyjhol,項目名稱:fullcalendar,代碼行數:7,代碼來源:locale.ts

示例3: locale

export function locale(localeCode, newFcOptions) {
  let fcOptions
  let momOptions

  // get the FullCalendar internal option hash for this locale. create if necessary
  fcOptions = localeOptionHash[localeCode] || (localeOptionHash[localeCode] = {})

  // provided new options for this locales? merge them in
  if (newFcOptions) {
    fcOptions = localeOptionHash[localeCode] = mergeOptions([ fcOptions, newFcOptions ])
  }

  // compute locale options that weren't defined.
  // always do this. newFcOptions can be undefined when initializing from i18n file,
  // so no way to tell if this is an initialization or a default-setting.
  momOptions = getMomentLocaleData(localeCode) // will fall back to en
  $.each(momComputableOptions, function(name, func) {
    if (fcOptions[name] == null) {
      fcOptions[name] = (func)(momOptions, fcOptions)
    }
  })

  // set it as the default locale for FullCalendar
  globalDefaults.locale = localeCode
}
開發者ID:caseyjhol,項目名稱:fullcalendar,代碼行數:25,代碼來源:locale.ts

示例4: generateNavigationButtons

  public generateNavigationButtons() {
    const div = $('#controls-navigation');
    div.empty();
    const jumps = [ 100, 500, 1000 ];
    $.each(jumps, (i, jump) => {
      const button = $(`<button>+${jump}</button>`);
      button.addClass('control-btn wide-btn nav-btn')
        .addClass('wide-btn')
        .click(() => {
          this.controller.incrementRNG(jump);
          this.selectRow(this.controller.getEncounterIndex());
        });
      div.append(button);
    });

    const undo = $('<button>Undo</button>')
      .addClass('control-btn wide-btn nav-btn')
      .click(() => {
        this.controller.undo();
        this.selectRow(this.controller.getEncounterIndex());
      });
    div.append(undo);

    const next = $('<button>Next</button>')
      .addClass('control-btn wide-btn nav-btn')
      .click(() => {
        this.controller.incrementFight();
        this.selectRow(this.controller.getEncounterIndex());
      });
    div.append(next);

    // this.controlContainer.append(div);
  }
開發者ID:ak505188,項目名稱:SuikodenRNG,代碼行數:33,代碼來源:EncounterToolView.ts

示例5: setTrInnerHeight

 /*
 Find each TRs "inner div" and sets all of their heights to the same value.
 */
 setTrInnerHeight(height) {
   // exclude multi-rowspans (probably done for row grouping)
   $.each(this.trHash, (type, tr) => {
     getOwnCells(tr).find('> div:not(.fc-cell-content):first')
       .height(height)
   })
 }
開發者ID:diomed,項目名稱:fullcalendar-scheduler,代碼行數:10,代碼來源:RowParent.ts

示例6: require

        require(addons, (): void => {
          const cm = CodeMirror.fromTextArea($textarea.get(0), {
            extraKeys: {
              'Ctrl-Alt-F': (codemirror: any): void => {
                codemirror.setOption('fullScreen', !codemirror.getOption('fullScreen'));
              },
              'Ctrl-Space': 'autocomplete',
              'Esc': (codemirror: any): void => {
                if (codemirror.getOption('fullScreen')) {
                  codemirror.setOption('fullScreen', false);
                }
              },
            },
            fullScreen: false,
            lineNumbers: true,
            lineWrapping: true,
            mode: modeParts[modeParts.length - 1],
          });

          // set options
          $.each(options, (key: string, value: any): void => {
            cm.setOption(key, value);
          });

          cm.addPanel(
            T3editor.createPanelNode('bottom', $textarea.attr('alt')),
            {
              position: 'bottom',
              stable: true,
            },
          );
        });
開發者ID:NeoBlack,項目名稱:TYPO3.CMS,代碼行數:32,代碼來源:T3editor.ts

示例7: datepickerLocale

export function datepickerLocale(localeCode, dpLocaleCode, dpOptions) {

  // get the FullCalendar internal option hash for this locale. create if necessary
  let fcOptions = localeOptionHash[localeCode] || (localeOptionHash[localeCode] = {})

  // transfer some simple options from datepicker to fc
  fcOptions.isRTL = dpOptions.isRTL
  fcOptions.weekNumberTitle = dpOptions.weekHeader

  // compute some more complex options from datepicker
  $.each(dpComputableOptions, function(name, func) {
    fcOptions[name] = func(dpOptions)
  })

  let jqDatePicker = ($ as any).datepicker

  // is jQuery UI Datepicker is on the page?
  if (jqDatePicker) {

    // Register the locale data.
    // FullCalendar and MomentJS use locale codes like "pt-br" but Datepicker
    // does it like "pt-BR" or if it doesn't have the locale, maybe just "pt".
    // Make an alias so the locale can be referenced either way.
    jqDatePicker.regional[dpLocaleCode] =
      jqDatePicker.regional[localeCode] = // alias
        dpOptions

    // Alias 'en' to the default locale data. Do this every time.
    jqDatePicker.regional.en = jqDatePicker.regional['']

    // Set as Datepicker's global defaults.
    jqDatePicker.setDefaults(dpOptions)
  }
}
開發者ID:caseyjhol,項目名稱:fullcalendar,代碼行數:34,代碼來源:locale.ts

示例8:

 plot.hideEvents = () => {
   $.each(eventMarkers._events, (index, event) => {
     event
       .visual()
       .getObject()
       .hide();
   });
 };
開發者ID:CorpGlory,項目名稱:grafana,代碼行數:8,代碼來源:jquery.flot.events.ts

示例9: loadStyles

 static loadStyles(tag, src) {
     if (Array.isArray(src)) {
         $.each(src, function(k, s) {
             $(tag).append($('<link/>').attr('href', s).attr('rel', 'stylesheet').attr('type', 'text/css'));
         });
     } else {
         $(tag).append($('<link/>').attr('href', src).attr('rel', 'stylesheet').attr('type', 'text/css'));
     }
 }
開發者ID:bhavdip13,項目名稱:Angular5_core2.1_EfCore,代碼行數:9,代碼來源:helpers.ts


注:本文中的jQuery.each函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。