From eda1cdd0c524009c897adacacda69ab2fa7c3241 Mon Sep 17 00:00:00 2001 From: Brock Whittaker Date: Tue, 9 Aug 2016 03:12:11 -0700 Subject: [PATCH] third: Add option for which container to append the color picker to. This allows you to select the container that the color picker should append to and therefore be absolutely positioned in accordance with. This still defaults to document body, which was the previously default container to append the color picker to. --- static/third/spectrum/spectrum.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/static/third/spectrum/spectrum.js b/static/third/spectrum/spectrum.js index 6ced3c552e..fe96b807dc 100644 --- a/static/third/spectrum/spectrum.js +++ b/static/third/spectrum/spectrum.js @@ -32,7 +32,10 @@ showAlpha: false, theme: "sp-light", palette: ['fff', '000'], - selectionPalette: [] + selectionPalette: [], + + // user-specified container + container: null }, spectrums = [], IE = !!/msie/i.exec( window.navigator.userAgent ), @@ -165,7 +168,7 @@ draggingClass = "sp-dragging"; var doc = element.ownerDocument, - body = doc.body, + body = opts.container || doc.body, boundElement = $(element), container = $(markup, doc).addClass(theme), dragger = container.find(".sp-color"),