Move config tooltip hook to separate file, for reuse by other upcoming changes, and create it at startup.

Mere [07-13-13 - 10:38]
Move config tooltip hook to separate file, for reuse by other upcoming changes, and create it at startup.
Filename
ConfigUI.lua
ConfigUI_Layouts.lua
MereHealingFrames.lua
RiftAddon.toc
UI/ToolTip.lua
diff --git a/ConfigUI.lua b/ConfigUI.lua
index 1297c16..df329b1 100644
--- a/ConfigUI.lua
+++ b/ConfigUI.lua
@@ -22,9 +22,6 @@ function MereHealingFrames.Config.UI:CreateConfigUI()
 	-- Ask the watchdog to be quiet:
 	Command.System.Watchdog.Quiet()

-    -- Create a tooltip
-    MereHealingFrames.Config.ToolTipControl = UI.CreateFrame("SimpleTooltip", "ToolTip",  MereHealingFrames.context)
-
 	self.Config_Window = UI.CreateFrame("SimpleWindow", "Config_Window", MereHealingFrames.context)
 	self.Config_Window:SetCloseButtonVisible(true)
 	self.Config_Window:SetTitle("Mere Healing Frames, " .. MereHealingFrames.fetchVersion())
diff --git a/ConfigUI_Layouts.lua b/ConfigUI_Layouts.lua
index 3a52dc4..ee5858a 100644
--- a/ConfigUI_Layouts.lua
+++ b/ConfigUI_Layouts.lua
@@ -276,7 +276,7 @@ function MereHealingFrames.Config.UI.Layouts:CreateSizingTab()

     self.sizing.anchorDropDown.Event.ItemSelect = function (item, value, index) MereHealingFrames.Config.UI.Layouts.ChangeAnchorPoint(self, index[1], index[2]) end

-    MereHealingFrames.Config.ToolTipControl:InjectEvents(self.sizing.anchorLabel, anchorPointToolTipText)
+    MereHealingFrames.UI.Utilities.ToolTip:InjectEvents(self.sizing.anchorLabel, anchorPointToolTipText)

     return self.sizing.Frame
 end
diff --git a/MereHealingFrames.lua b/MereHealingFrames.lua
index 6ed6f19..3014e0b 100644
--- a/MereHealingFrames.lua
+++ b/MereHealingFrames.lua
@@ -20,6 +20,8 @@ function MereHealingFrames.fetchVersion()
 	return "Version " ..  MereHealingFrames.toc.Version
 end

+MereHealingFrames.UI.Utilities.CreateToolTipHook()
+
 MereHealingFrames.RaidManagement.LibUnitChange.Register()
 LibVersionCheck.register(MereHealingFrames.toc.Identifier, MereHealingFrames.toc.Version)

diff --git a/RiftAddon.toc b/RiftAddon.toc
index 886f038..08a07d4 100644
--- a/RiftAddon.toc
+++ b/RiftAddon.toc
@@ -22,6 +22,7 @@ RunOnStartup = {
 	"CommandLine.lua",
 	"HealingBar.lua",
 	"HotIcon.lua",
+	"UI/ToolTip.lua",
 	"ConfigUI.lua",
 	"ConfigUI_SetsFrame.lua",
 	"ConfigUI_Layouts.lua",
diff --git a/UI/ToolTip.lua b/UI/ToolTip.lua
new file mode 100644
index 0000000..d2003c5
--- /dev/null
+++ b/UI/ToolTip.lua
@@ -0,0 +1,14 @@
+-- This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
+-- To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/
+-- or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
+
+local MereHealingFrames, privateVars = ...
+
+MereHealingFrames.UI = MereHealingFrames.UI or {}
+MereHealingFrames.UI.Utilities = MereHealingFrames.UI.Utilities or {}
+
+function MereHealingFrames.UI.Utilities.CreateToolTipHook()
+    if (MereHealingFrames.UI.Utilities.ToolTip == nil) then
+        MereHealingFrames.UI.Utilities.ToolTip = UI.CreateFrame("SimpleTooltip", "ToolTip",  MereHealingFrames.context)
+    end
+end