It could be something as simple as adjusting the SetPoint of the side bar when the button is clicked
Something OnClick like:
Lua Code:
local point = SideBarFrame:GetPoint(1)
SideBarFrame:ClearAllpoints()
if point == "LEFT" then
SideBarFrame:SetPoint("RIGHT", UIParent, "LEFT")
else
SideBarFrame:SetPoint("LEFT", UIParent, "LEFT")
end
The button would be attached to the left of the SideBar panel and "move" with it.
You might want to change:
Code:
if point == "LEFT" then
from "LEFT" to "RIGHT" depending on which side of the SideBar you initially attach to the left of UIParent.