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


TypeScript jb.delay方法代碼示例

本文整理匯總了TypeScript中jb-core.jb.delay方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript jb.delay方法的具體用法?TypeScript jb.delay怎麽用?TypeScript jb.delay使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在jb-core.jb的用法示例。


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

示例1: message

export function message(message,error) {
	$('.studio-message').text(message); // add animation
	$('.studio-message').css('background', error ? 'red' : '#327DC8');
	$('.studio-message').css('animation','');
	jb.delay(1).then(()=>
		$('.studio-message').css('animation','slide_from_top 5s ease')
	)
}
開發者ID:ArtwareSoft,項目名稱:jbart5-ng,代碼行數:8,代碼來源:studio-utils.ts

示例2: paste

 paste(ctx,close) {
   var toPaste = this.toPaste + ((typeof this.value != 'object' || close) ? '%' : '/');
   var suggestionCtx = ctx.vars.suggestionCtx;
   var input = suggestionCtx.input;
   var pos = this.pos + 1;
   input.value = input.value.substr(0,this.pos-this.tail.length) + toPaste + input.value.substr(pos);
   suggestionCtx.show = false;
   suggestionCtx.selected = null;
   return jb.delay(1,ctx).then (() => {
     input.selectionStart = pos + toPaste.length;
     input.selectionEnd = input.selectionStart;
   })
 }
開發者ID:ArtwareSoft,項目名稱:jbart5-ng,代碼行數:13,代碼來源:studio-suggestions.ts

示例3: modify

	modify(op,path,args,ctx,delayed) {
		var comp = path.split('~')[0];
		var before = getComp(comp) && compAsStr(comp);
		var res = op.call(this,path,args);
		if (res && res.newPath) // used for insert to array that creates new path
			path = res.newPath;
		jb.delay(delayed?1:0).then(()=>{
			modifyOperationsEm.next({ 
				comp: comp, 
				before: before, 
				after: compAsStr(comp), 
				path: path, 
				args: args, 
				ctx: ctx, 
//				jbart: findjBartToLook(path),
				newComp: before ? false: true
			})
		})
	}
開發者ID:ArtwareSoft,項目名稱:jbart5-ng,代碼行數:19,代碼來源:studio-tgp-model.ts

示例4: function

      afterViewInit: function(cmp) {
        var suggestionCtx = ctx.vars.suggestionCtx;

        jb.delay(1,ctx).then(()=>{// ctx.vars.ngZone.runOutsideAngular(() => {
          var keyEm = suggestionCtx.keyEm;

          keyEm.filter(e=>
              e.keyCode == 13) // ENTER
            .subscribe(()=>{
                suggestionCtx.show = false;
                if (suggestionCtx.selected && suggestionCtx.selected.paste) {
                  suggestionCtx.selected.paste(ctx);
                  suggestionCtx.selected = null;
                }
                jb_ui.apply(ctx);
            })
          keyEm.filter(e=>e.keyCode == 27) // ESC
            .subscribe(x=>
                suggestionCtx.show = false)

          keyEm.filter(e=>
                  e.keyCode == 38 || e.keyCode == 40)
              .subscribe(e=>{
                  var diff = e.keyCode == 40 ? 1 : -1;
                  var items = cmp.items; //.filter(item=>!item.heing);
                  var newIndex = (items.indexOf(suggestionCtx.selected) + diff + items.length) % items.length;
                  cmp.selected = suggestionCtx.selected = items[newIndex];
                  jb_logPerformance('suggestions',newIndex,suggestionCtx.selected);
                  suggestionCtx.refresh();
                  e.preventDefault();
              })

          suggestionCtx.suggestionEm.subscribe(e=> {
              suggestionCtx.show = e.options.length > 0;
              suggestionCtx.options = e.options;
              suggestionCtx.selected = e.options[0];
              suggestionCtx.refresh();
           })
        })
      },
開發者ID:ArtwareSoft,項目名稱:jbart5-ng,代碼行數:40,代碼來源:studio-suggestions.ts

示例5: resolve

          .subscribe(x=>{
            if (!forTests)
              jb.delay(1,ctx).then(()=>dialog.close()); // delay to avoid race conditin with itself
//            console.log('close test dialog',ctx.id);
            resolve({ element : cmp.elementRef.nativeElement });
          })
開發者ID:ArtwareSoft,項目名稱:jbart5-ng,代碼行數:6,代碼來源:studio-probe.ts


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