|
@@ -5,7 +5,8 @@ define [
|
|
|
return {
|
|
return {
|
|
|
link: (scope, element, attrs) ->
|
|
link: (scope, element, attrs) ->
|
|
|
TOOLBAR_HEIGHT = 28
|
|
TOOLBAR_HEIGHT = 28
|
|
|
- ENTRY_PADDING = 12
|
|
|
|
|
|
|
+ BOX_PADDING = 12
|
|
|
|
|
+ INDICATOR_PADDING = 4
|
|
|
|
|
|
|
|
previous_focused_entry_index = 0
|
|
previous_focused_entry_index = 0
|
|
|
|
|
|
|
@@ -43,31 +44,55 @@ define [
|
|
|
focused_entry.$indicator_el.css(top: focused_entry_top)
|
|
focused_entry.$indicator_el.css(top: focused_entry_top)
|
|
|
focused_entry.$callout_el.css(top: focused_entry_top + line_height, height: 0)
|
|
focused_entry.$callout_el.css(top: focused_entry_top + line_height, height: 0)
|
|
|
|
|
|
|
|
- previousBottom = focused_entry_top + focused_entry.$box_el.height()
|
|
|
|
|
|
|
+ previousBoxBottom = focused_entry_top + focused_entry.$box_el.height()
|
|
|
|
|
+ previousIndicatorBottom = focused_entry_top + focused_entry.$indicator_el.height()
|
|
|
for entry in entries_after
|
|
for entry in entries_after
|
|
|
- height = entry.$box_el.height()
|
|
|
|
|
original_top = entry.scope.entry.screenPos.y
|
|
original_top = entry.scope.entry.screenPos.y
|
|
|
- top = Math.max(original_top, previousBottom + ENTRY_PADDING)
|
|
|
|
|
- previousBottom = top + height
|
|
|
|
|
- entry.$box_el.css(top: top, bottom: 'auto')
|
|
|
|
|
- entry.$indicator_el.css(top: top, bottom: 'auto')
|
|
|
|
|
|
|
+ box_height = entry.$box_el.height()
|
|
|
|
|
+ box_top = Math.max(original_top, previousBoxBottom + BOX_PADDING)
|
|
|
|
|
+ indicator_height = entry.$indicator_el.height()
|
|
|
|
|
+ indicator_top = Math.max(original_top, previousIndicatorBottom + INDICATOR_PADDING)
|
|
|
|
|
+ previousBoxBottom = box_top + box_height
|
|
|
|
|
+ previousIndicatorBottom = indicator_top + indicator_height
|
|
|
|
|
+ entry.$box_el.css(top: box_top, bottom: 'auto')
|
|
|
|
|
+ entry.$indicator_el.css(top: indicator_top, bottom: 'auto')
|
|
|
|
|
+
|
|
|
entry.$callout_el.removeClass("rp-entry-callout-inverted")
|
|
entry.$callout_el.removeClass("rp-entry-callout-inverted")
|
|
|
- entry.$callout_el.css(top: original_top + line_height, height: top - original_top)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if scope.ui.reviewPanelOpen
|
|
|
|
|
+ callout_height = box_top - original_top
|
|
|
|
|
+ else
|
|
|
|
|
+ callout_height = indicator_top - original_top
|
|
|
|
|
+
|
|
|
|
|
+ entry.$callout_el.css(top: original_top + line_height, height: callout_height)
|
|
|
sl_console.log "ENTRY", {entry: entry.scope.entry, top}
|
|
sl_console.log "ENTRY", {entry: entry.scope.entry, top}
|
|
|
|
|
|
|
|
- previousTop = focused_entry_top
|
|
|
|
|
|
|
+ previousBoxTop = focused_entry_top
|
|
|
|
|
+ previousIndicatorTop = focused_entry_top
|
|
|
entries_before.reverse() # Work through backwards, starting with the one just above
|
|
entries_before.reverse() # Work through backwards, starting with the one just above
|
|
|
for entry in entries_before
|
|
for entry in entries_before
|
|
|
- height = entry.$box_el.height()
|
|
|
|
|
original_top = entry.scope.entry.screenPos.y
|
|
original_top = entry.scope.entry.screenPos.y
|
|
|
- original_bottom = original_top + height
|
|
|
|
|
- bottom = Math.min(original_bottom, previousTop - ENTRY_PADDING)
|
|
|
|
|
- top = bottom - height
|
|
|
|
|
- previousTop = top
|
|
|
|
|
- entry.$box_el.css(top: top)
|
|
|
|
|
- entry.$indicator_el.css(top: top, bottom: 'auto')
|
|
|
|
|
|
|
+ box_height = entry.$box_el.height()
|
|
|
|
|
+ original_box_bottom = original_top + box_height
|
|
|
|
|
+ box_bottom = Math.min(original_box_bottom, previousBoxTop - BOX_PADDING)
|
|
|
|
|
+ box_top = box_bottom - box_height
|
|
|
|
|
+ indicator_height = entry.$indicator_el.height()
|
|
|
|
|
+ original_indicator_bottom = original_top + indicator_height
|
|
|
|
|
+ indicator_bottom = Math.min(original_indicator_bottom, previousIndicatorTop - INDICATOR_PADDING)
|
|
|
|
|
+ indicator_top = indicator_bottom - indicator_height
|
|
|
|
|
+ previousBoxTop = box_top
|
|
|
|
|
+ previousIndicatorTop = indicator_top
|
|
|
|
|
+ entry.$box_el.css(top: box_top, bottom: 'auto')
|
|
|
|
|
+ entry.$indicator_el.css(top: indicator_top, bottom: 'auto')
|
|
|
|
|
+
|
|
|
entry.$callout_el.addClass("rp-entry-callout-inverted")
|
|
entry.$callout_el.addClass("rp-entry-callout-inverted")
|
|
|
- entry.$callout_el.css(top: top + line_height + 1, height: original_top - top)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if scope.ui.reviewPanelOpen
|
|
|
|
|
+ callout_top = box_top + line_height
|
|
|
|
|
+ else
|
|
|
|
|
+ callout_top = indicator_top + line_height
|
|
|
|
|
+
|
|
|
|
|
+ entry.$callout_el.css(top: callout_top + 1, height: original_top - callout_top + line_height)
|
|
|
sl_console.log "ENTRY", {entry: entry.scope.entry, top}
|
|
sl_console.log "ENTRY", {entry: entry.scope.entry, top}
|
|
|
|
|
|
|
|
scope.$watch "reviewPanel.entryGeneration", (value) ->
|
|
scope.$watch "reviewPanel.entryGeneration", (value) ->
|