From 72c5fcad8222ce5a67cbcc7da3adb65cc586b419 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 10 Oct 2016 14:03:08 -0600 Subject: [PATCH] Eliminate selector option in tooltip manager API No packages use it currently, and it's really complex to support so we should kill it while we have the chance. When it comes time to rewrite the tooltip code or add features, not worrying about selectors will make it easier. --- spec/tooltip-manager-spec.coffee | 14 -------------- src/tooltip-manager.coffee | 1 + 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/spec/tooltip-manager-spec.coffee b/spec/tooltip-manager-spec.coffee index 3783c904d..6bebd6e76 100644 --- a/spec/tooltip-manager-spec.coffee +++ b/spec/tooltip-manager-spec.coffee @@ -91,20 +91,6 @@ describe "TooltipManager", -> hover element, -> expect(document.body.querySelector(".tooltip")).toBeNull() hover element2, -> expect(document.body.querySelector(".tooltip")).toBeNull() - describe "when a selector is specified", -> - it "creates a tooltip when hovering over a descendant of the target that matches the selector", -> - child = document.createElement('div') - child.classList.add('bar') - grandchild = document.createElement('div') - element.appendChild(child) - child.appendChild(grandchild) - - manager.add element, selector: '.bar', title: 'Bar' - - hover grandchild, -> - expect(document.body.querySelector('.tooltip')).toHaveText('Bar') - expect(document.body.querySelector('.tooltip')).toBeNull() - describe "when a keyBindingCommand is specified", -> describe "when a title is specified", -> it "appends the key binding corresponding to the command to the title", -> diff --git a/src/tooltip-manager.coffee b/src/tooltip-manager.coffee index fc89ebff4..4419ec740 100644 --- a/src/tooltip-manager.coffee +++ b/src/tooltip-manager.coffee @@ -122,6 +122,7 @@ class TooltipManager else if keystroke? options.title = getKeystroke(bindings) + delete options.selector options = _.defaults(options, @defaults) if options.trigger is 'hover' options = _.defaults(options, @hoverDefaults)