当前位置: 首页>>代码示例>>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;未经允许,请勿转载。