From 85095eda44c13399c8a7ac180bbc47c1f4b219aa Mon Sep 17 00:00:00 2001 From: j Date: Fri, 1 Nov 2019 15:22:53 +0100 Subject: [PATCH] only use current search if its inside a layer --- static/js/editor.js | 2 +- static/js/utils.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/static/js/editor.js b/static/js/editor.js index 562c3bc0f..6c3106b9f 100644 --- a/static/js/editor.js +++ b/static/js/editor.js @@ -28,7 +28,7 @@ pandora.ui.editor = function(data) { enableSetPosterFrame: !pandora.site.media.importFrames && data.editable, enableSubtitles: ui.videoSubtitles, find: ui.itemFind, - findLayer: ui._findState.key, + findLayer: pandora.getFindLayer(), getFrameURL: function(position) { return pandora.getMediaURL('/' + ui.item + '/' + ui.videoResolution + 'p' + position + '.jpg?' + data.modified); }, diff --git a/static/js/utils.js b/static/js/utils.js index d2667546e..977c95e7c 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -1439,6 +1439,14 @@ pandora.getFoldersWidth = function(section) { return width; }; +pandora.getFindLayer = function() { + var key = pandora.user.ui._findState.key + if (!!Ox.getObjectById(pandora.site.layers, key)) { + key = 'all' + } + return key +}; + pandora.getHash = function(state, callback) { // FIXME: remove this var embedKeys = [