add ui.editSidebarSize and update on resize, fixes #2716

This commit is contained in:
j 2017-04-17 18:18:10 +02:00
parent be34383f8c
commit 4445b33718
5 changed files with 8 additions and 11 deletions

View file

@ -1226,6 +1226,7 @@
"edit": "", "edit": "",
"edits": {}, "edits": {},
"editSelection": [], "editSelection": [],
"editSidebarSize": 416,
"editSort": [ "editSort": [
{"key": "index", "operator": "+"}, {"key": "index", "operator": "+"},
{"key": "year", "operator": "+"}, {"key": "year", "operator": "+"},

View file

@ -1697,6 +1697,7 @@
"edit": "", "edit": "",
"edits": {}, "edits": {},
"editSelection": [], "editSelection": [],
"editSidebarSize": 416,
"editSort": [ "editSort": [
{"key": "index", "operator": "+"}, {"key": "index", "operator": "+"},
{"key": "year", "operator": "+"}, {"key": "year", "operator": "+"},

View file

@ -1177,6 +1177,7 @@
"edit": "", "edit": "",
"edits": {}, "edits": {},
"editSelection": [], "editSelection": [],
"editSidebarSize": 416,
"editSort": [ "editSort": [
{"key": "index", "operator": "+"}, {"key": "index", "operator": "+"},
{"key": "director", "operator": "+"}, {"key": "director", "operator": "+"},

View file

@ -1117,6 +1117,7 @@ examples (config.SITENAME.jsonc) that are part of this pan.do/ra distribution.
"edit": "", "edit": "",
"edits": {}, "edits": {},
"editSelection": [], "editSelection": [],
"editSidebarSize": 416,
"editSort": [ "editSort": [
{"key": "index", "operator": "+"}, {"key": "index", "operator": "+"},
{"key": "year", "operator": "+"}, {"key": "year", "operator": "+"},

View file

@ -4,12 +4,6 @@ pandora.ui.editPanel = function(isEmbed) {
var ui = pandora.user.ui, var ui = pandora.user.ui,
edit, edit,
listSizes = [
144 + Ox.UI.SCROLLBAR_SIZE,
280 + Ox.UI.SCROLLBAR_SIZE,
416 + Ox.UI.SCROLLBAR_SIZE
],
listSize = listSizes[ui.clipColumns],
smallTimelineCanvas, smallTimelineCanvas,
smallTimelineContext, smallTimelineContext,
that = Ox.Element(); that = Ox.Element();
@ -83,12 +77,11 @@ pandora.ui.editPanel = function(isEmbed) {
annotationsCalendarSize: ui.annotationsCalendarSize, annotationsCalendarSize: ui.annotationsCalendarSize,
annotationsMapSize: ui.annotationsMapSize, annotationsMapSize: ui.annotationsMapSize,
annotationsRange: ui.annotationsRange, annotationsRange: ui.annotationsRange,
annotationsSize: ui.annotationsSize,
annotationsSort: ui.annotationsSort, annotationsSort: ui.annotationsSort,
clickLink: pandora.clickLink, clickLink: pandora.clickLink,
clipRatio: pandora.site.video.previewRatio, clipRatio: pandora.site.video.previewRatio,
clips: Ox.clone(edit.clips), clips: Ox.clone(edit.clips),
clipSize: listSize, clipSize: ui.editSidebarSize + Ox.UI.SCROLLBAR_SIZE,
clipTooltip: 'clips <span class="OxBright">' + Ox.SYMBOLS.shift + 'C</span>', clipTooltip: 'clips <span class="OxBright">' + Ox.SYMBOLS.shift + 'C</span>',
clipView: ui.edits[ui.edit].view, clipView: ui.edits[ui.edit].view,
controlsTooltips: { controlsTooltips: {
@ -155,6 +148,9 @@ pandora.ui.editPanel = function(isEmbed) {
width: Ox.$document.width() - pandora.$ui.mainPanel.size(0) - 1 width: Ox.$document.width() - pandora.$ui.mainPanel.size(0) - 1
}) })
.bindEvent({ .bindEvent({
clipSize: function(data) {
pandora.UI.set({editSidebarSize: data.size - Ox.UI.SCROLLBAR_SIZE});
},
copy: function(data) { copy: function(data) {
var ids = Ox.sort(data.ids, function(id) { var ids = Ox.sort(data.ids, function(id) {
return Ox.getObjectById(edit.clips, id).index; return Ox.getObjectById(edit.clips, id).index;
@ -334,9 +330,6 @@ pandora.ui.editPanel = function(isEmbed) {
select: function(data) { select: function(data) {
pandora.UI.set({editSelection: data.ids}); pandora.UI.set({editSelection: data.ids});
}, },
size: function(data) {
pandora.UI.set({clipSize: data.size});
},
sort: function(data) { sort: function(data) {
pandora.UI.set({editSort: data}); pandora.UI.set({editSort: data});
sortClips(updateClips); sortClips(updateClips);