From dc7582752c2fd640b0d625d600f4d6640a5b551a Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 8 Sep 2013 17:59:22 +0000 Subject: [PATCH] fix editing embed urls --- static/js/insertEmbedDialog.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/static/js/insertEmbedDialog.js b/static/js/insertEmbedDialog.js index 939f8a65b..eac641ba7 100644 --- a/static/js/insertEmbedDialog.js +++ b/static/js/insertEmbedDialog.js @@ -402,7 +402,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) { }) .appendTo($form); - url ? parseURL() : formatURL(); + url ? parseURL(url) : formatURL(); updateForm(); } else { @@ -458,6 +458,12 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) { } function limitPoint(value, min, max) { + if (Ox.typeOf(min) == 'number') { + min = Ox.formatDuration(min) + } + if (Ox.typeOf(max) == 'number') { + max = Ox.formatDuration(max) + } return Ox.formatDuration( Ox.limit( Ox.parseDuration(value), @@ -477,7 +483,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) { var isSameItem = isSameSite && state.item == item, id = (isSameSite ? state.item : url.split('/')[3]) || item, query = {}; - if (state.hash) { + if (state.hash && state.hash.query) { state.hash.query.forEach(function(condition) { query[condition.key] = condition.value; });