## can/control/control.js ## control.js `can.Control` _Controller_ Binds an element, returns a function that unbinds.
337893
function (el, selector, ev, callback) {
            can.delegate.call(el, selector, ev, callback);
            return function () {
                can.undelegate.call(el, selector, ev, callback);
            };
        }
311622
function(actionData) {
						// unbinds the old binding
						controlInstance._bindings.control[methodName](controlInstance.element);
						// binds the new
						controlInstance._bindings.control[methodName] = actionData.processor(
							actionData.delegate || controlInstance.element,
							actionData.parts[2], actionData.parts[1], methodName, controlInstance);
					}
233740
function (config, unselect) {
			
			var position, choice;
			
			// Should we unselect choice if disabling selected choice
			if (lang.isUndefined(unselect) || !lang.isBoolean(unselect)) { unselect = true; }
			
			position = this.getChoicePosition(config);
			
			if (position !== -1) {
				
				choice = this.choicesList[position];
				
				this.disableChoiceNode(choice.node);
				
				// Clear if disabling selected choice
				if (unselect && this.getValue() === choice.value) {
					this.clear();
				}
				
			}
			
		}
1310819
function(){
            if(!this._boundElement){
                return false;
            }
            var el = this._boundElement;
            el.removeEventListener('mousemove', this);
            el.removeEventListener('mouseenter', this);
            el.removeEventListener('mouseleave', this);
            el.removeEventListener('click', this);
        }
489549
function (element, type, handler) {
            var own = this;
            //非DOM元素不处理 handler 非function 不处理
            if (!(1 == element.nodeType || element.nodeType == 9 || element === window) || !vQ.isFunction(handler)) {
                return;
            }

            //批量事件绑定
            if (vQ.isArray(type)) {
                return own._handleMultipleEvents(own.remove, element, type, handler);
            }
            //处理绑定了了context的事件
            var _handler = own._contextHandler[handler.$$guid];// || handler;

            //调用原生方法解除已绑定事件
            if (element.removeEventListener) {
                element.removeEventListener(type, _handler || handler, false);
            } else {
                //IE等 自行托管事件

                // delete the event handler from the hash table
                var events = element.events;
                if (events) {
                    delete events[handler.$$guid];//删除该方法
                    //判断事件集合是否为空
                    var hasProp = false;
                    for (var prop in events) {
                        hasProp = true;
                    }
                    if (!hasProp) {
                        delete element.events;
                    }
                }
            }
            if (_handler && !delete own._contextHandler[handler.$$guid]) {
                own._contextHandler[handler.$$guid] = null;
            }
        }
833395
function (node, oScope) {
				/**
				 * Here we white list all controls that can contain DOM elements with style different than the framework style
				 */
				var skipParents = ["sap.ui.core.HTML"],
					parentNode = jQuery(node).control()[0];

				if (!parentNode) {
					return false;
				}

				var parentName = parentNode.getMetadata().getName(),
					isParentOutOfSkipList = skipParents.indexOf(parentName) === -1,
					isParentInScope = oScope.getElements().indexOf(parentNode) > -1;

				return isParentOutOfSkipList && isParentInScope;

			}
202846
function unbindEventListeners(instanceData) {
		for (var type in instanceData.eventHandlers) {
			if (instanceData.eventHandlers.hasOwnProperty(type)) {
				$(instanceData.element).off(type, instanceData.eventHandlers[type]);
			}
		}

		instanceData.eventHandlers = {};
	}
1370427
function removeBindings() {
      for (var i = 0; i < this._c.length; i++) {
        this.unbind(this._c[i].children);
      }
    }
1103902
function () {
			var el = this.constructor.unwrapElement(this.element),
				bindings = this._bindings;
			if( bindings ) {
				(bindings.user || []).forEach(function (value) {
					value(el);
				});
				canReflect.eachKey(bindings.control || {}, function (value) {
					value(el);
				});
				canReflect.eachKey(bindings.readyComputes || {}, function(value) {
					canReflect.offValue(value.compute, value.handler, "mutate");
				});
			}
			// Adds bindings.
			this._bindings = {user: [], control: {}, readyComputes: {}};
		}
757489
function makeElementUnselectable(element) {
      if (typeof element.onselectstart !== 'undefined') {
        element.onselectstart = fabric.util.falseFunction;
      }
      if (selectProp) {
        element.style[selectProp] = 'none';
      }
      else if (typeof element.unselectable == 'string') {
        element.unselectable = 'on';
      }
      return element;
    }
1025181
function()
              {
                container.find('td.Radio input').unbind('click', radioClicked);
                currentPreview.unbind('click', currentClicked);
                cancelButton.unbind('click', cancelClicked);
                okButton.unbind('click', okClicked);
                if (settings.window.expandable)
                {
                  iconImage.unbind('click', iconImageClicked);
                  moveBar.unbind('mousedown', moveBarMouseDown);
                  $this.icon = null;
                }
                container.find('.QuickColor').unbind('click', quickPickClicked);
                colorMapDiv = null;
                colorBarDiv = null;
                colorMapL1 = null;
                colorMapL2 = null;
                colorMapL3 = null;
                colorBarL1 = null;
                colorBarL2 = null;
                colorBarL3 = null;
                colorBarL4 = null;
                colorBarL5 = null;
                colorBarL6 = null;
                colorMap.destroy();
                colorMap = null;
                colorBar.destroy();
                colorBar = null;
                colorPicker.destroy();
                colorPicker = null;
                activePreview = null;
                currentPreview = null;
                okButton = null;
                cancelButton = null;
                grid = null;
                commitCallback = null;
                cancelCallback = null;
                liveCallback = null;
                container.html('');
                for (i = 0; i < List.length; i++) if (List[i] == $this) List.splice(i, 1);
              }
500288
function onRemove(scope, element, options) {
      options.deactivateListeners();
      options.unlockScreenReader();
      options.hideBackdrop(options.$destroy);

      // Remove the focus traps that we added earlier for keeping focus within the dialog.
      if (topFocusTrap && topFocusTrap.parentNode) {
        topFocusTrap.parentNode.removeChild(topFocusTrap);
      }

      if (bottomFocusTrap && bottomFocusTrap.parentNode) {
        bottomFocusTrap.parentNode.removeChild(bottomFocusTrap);
      }

      // For navigation $destroy events, do a quick, non-animated removal,
      // but for normal closes (from clicks, etc) animate the removal
      return options.$destroy ? detachAndClean() : animateRemoval().then(detachAndClean);

      /**
       * For normal closes, animate the removal.
       * For forced closes (like $destroy events), skip the animations
       */
      function animateRemoval() {
        return dialogPopOut(element, options);
      }

      /**
       * Detach the element
       */
      function detachAndClean() {
        angular.element($document[0].body).removeClass('md-dialog-is-showing');

        // Reverse the container stretch if using a content element.
        if (options.contentElement) {
          options.reverseContainerStretch();
        }

        // Exposed cleanup function from the $mdCompiler.
        options.cleanupElement();

        // Restores the focus to the origin element if the last interaction upon opening was a keyboard.
        if (!options.$destroy && options.originInteraction === 'keyboard') {
          options.origin.focus();
        }
      }
    }
793523
function disableHandler(e) {
    const element = e.detail.element;

    that.remove(element);
    clearToolOptionsByElement(element);
  }
355106
function() {
                    if (this.element === null) {

                        return;
                    }
                    var Class = this.constructor,
                        pluginName = Class.pluginName || Class._fullName,
                        controls;

                    this.off();

                    if (pluginName && pluginName !== 'can_control') {
                        this.element.removeClass(pluginName);
                    }

                    controls = can.data(this.element, "controls");
                    controls.splice(can.inArray(this, controls), 1);

                    can.trigger(this, "destroyed");

                    this.element = null;
                }
136584
public void unbindExternalFunction(String funcName) throws Exception {
		ifAsyncWeCant("unbind an external a function");
		Assert(externals.containsKey(funcName), "Function '" + funcName + "' has not been bound.");
		externals.remove(funcName);
	}
1215134
function selectorBlockHandler(element) {
    if (element.type === 'Selector') {
        const name = []
        let discard = false
        element.children.forEach(e => {
            switch (e.type) {
                case "ClassSelector":
                    name.push("." + e.name);
                    break;
                    //not support for now
                case "Combinator":
                    name.push(e.name);
                    discard = true
                    return null
                case "TypeSelector":
                    name.push(e.name);
                    break;
                case "IdSelector":
                    //not support for now
                    name.push("#" + e.name);
                    discard = true
                    return null
                case "WhiteSpace":
                    name.push(" ");
                    break
                default: {
                    // console.warn('unknown selector type:', e)
                    discard = true
                    return null
                }
            }
        })
        if (!discard)
            return name.join("")
        else return null
    }
}
382136
function() {
                    if (!tornDown) {
                        tornDown = true;
                        unbind(data);
                        can.unbind.call(el, 'removed', teardown);
                    }
                    return true;
                }