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


TypeScript refs._document類代碼示例

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


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

示例1: function

 _build: function(node, model, ctx, component) {
     var fragment = _document.createDocumentFragment();
     
     build(node.nodes, model, ctx, fragment, component);
     
     return fragment;
 }
開發者ID:atmajs,項目名稱:MaskJS,代碼行數:7,代碼來源:each.ts

示例2: _renderPlaceholder

export function _renderPlaceholder(staticCompo, compo, container) {
    var placeholder = staticCompo.placeholder;
    if (placeholder == null) {
        placeholder = _document.createComment('');
        container.appendChild(placeholder);
    }
    compo.placeholder = placeholder;
}
開發者ID:atmajs,項目名稱:MaskJS,代碼行數:8,代碼來源:utils.ts

示例3: function

    nodeRenderStart: function(expr, model, ctx, el, ctr, type, node){

        var current = expression_eval_safe(expr, model, ctx, ctr, node);

        // though we apply value's to `this` context, but it is only for immediat use
        // in .node() function, as `this` context is a static object that share all bind
        // utils
        this.element = _document.createTextNode(current);

        return (this.current = current);
    },
開發者ID:atmajs,項目名稱:MaskJS,代碼行數:11,代碼來源:bind.ts

示例4: compo_renderChildren

export function compo_renderChildren (compo, anchor, model?){
    var fragment = _document.createDocumentFragment();
    compo.elements = compo_renderElements(
        compo.nodes,
        model || compo.model,
        compo.ctx,
        fragment,
        compo
    );
    dom_insertBefore(fragment, anchor);
    compo_inserted(compo);
};
開發者ID:atmajs,項目名稱:MaskJS,代碼行數:12,代碼來源:compo.ts

示例5: list_sort

export function list_sort (self, array){

    var compos = self.node.components,
        i = 0,
        imax = compos.length,
        j = 0,
        jmax = null,
        element = null,
        compo = null,
        fragment = _document.createDocumentFragment(),
        sorted = [];

    for (; i < imax; i++) {
        compo = compos[i];
        if (compo.elements == null || compo.elements.length === 0) 
            continue;
        
        for (j = 0, jmax = compo.elements.length; j < jmax; j++) {
            element = compo.elements[j];
            element.parentNode.removeChild(element);
        }
    }
    
    outer: for (j = 0, jmax = array.length; j < jmax; j++) {

        for (i = 0; i < imax; i++) {
            if (array[j] === self._getModel(compos[i])) {
                sorted[j] = compos[i];
                continue outer;
            }
        }
        console.warn('No Model Found for', array[j]);
    }

    for (i = 0, imax = sorted.length; i < imax; i++) {
        compo = sorted[i];

        if (compo.elements == null || compo.elements.length === 0) {
            continue;
        }

        for (j = 0, jmax = compo.elements.length; j < jmax; j++) {
            element = compo.elements[j];

            fragment.appendChild(element);
        }
    }

    self.components = self.node.components = sorted;
    dom_insertBefore(fragment, self.placeholder);
};
開發者ID:atmajs,項目名稱:MaskJS,代碼行數:51,代碼來源:utils.ts

示例6: function

    refresh: function() {
        var currentIndex = this.index,
            model = this.model,
            ctx = this.ctx,
            ctr = this.controller,
            switch_ = this.Switch,
            imax = switch_.length,
            i = -1;
        while ( ++i < imax ){
            var node = switch_[i].node;
            var expr = node.expression;
            if (expr == null)
                break;				
            if (expression_eval_safe(expr, model, ctx, ctr, node))
                break;
        }

        if (currentIndex === i)
            return;

        if (currentIndex != null)
            els_toggleVisibility(switch_[currentIndex].elements, false);

        if (i === imax) {
            this.index = null;
            return;
        }

        this.index = i;

        var current = switch_[i];
        if (current.elements != null) {
            els_toggleVisibility(current.elements, true);
            return;
        }

        var nodes = current.node.nodes,
            frag = _document.createDocumentFragment(),
            owner = { components: [], parent: ctr },
            els = compo_renderElements(nodes, model, ctx, frag, owner);

        dom_insertBefore(frag, this.placeholder);
        current.elements = els;

        compo_inserted(owner);
        if (ctr.components == null) {
            ctr.components = [];
        }
        ctr.components.push.apply(ctr.components, owner.components);
    },
開發者ID:atmajs,項目名稱:MaskJS,代碼行數:50,代碼來源:if.ts

示例7: el_renderPlaceholder

export function el_renderPlaceholder (container) {
    let anchor = _document.createComment('');
    container.appendChild(anchor);
    return anchor;
}
開發者ID:atmajs,項目名稱:MaskJS,代碼行數:5,代碼來源:utils.ts


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