Merge branch 'interface' of github.com:martini/zammad into interface

This commit is contained in:
Martin Edenhofer 2014-08-28 09:25:13 +02:00
commit f889b84162
3 changed files with 97 additions and 68 deletions

View file

@ -294,7 +294,11 @@ class Sidebar extends App.Controller
toggleTab: (e) -> toggleTab: (e) ->
name = $(e.target).closest('.sidebar-tab').data('content') name = $(e.target).closest('.sidebar-tab').data('content')
if name if name
if name is @currentTab
@toggleSidebar()
else
@el.find('.ticket-zoom .sidebar-tab').removeClass('active') @el.find('.ticket-zoom .sidebar-tab').removeClass('active')
$(e.target).closest('.sidebar-tab').addClass('active') $(e.target).closest('.sidebar-tab').addClass('active')
@ -309,6 +313,7 @@ class Sidebar extends App.Controller
@el.find('.sidebar-content[data-content=' + name + ']').removeClass('hide') @el.find('.sidebar-content[data-content=' + name + ']').removeClass('hide')
title = @el.find('.sidebar-content[data-content=' + name + ']').data('title') title = @el.find('.sidebar-content[data-content=' + name + ']').data('title')
@el.find('.sidebar h2').html(title) @el.find('.sidebar h2').html(title)
@currentTab = name
class Edit extends App.Controller class Edit extends App.Controller
@ -318,6 +323,8 @@ class Edit extends App.Controller
'click .visibility.toggle': 'toggle_visibility' 'click .visibility.toggle': 'toggle_visibility'
'click .pop-selectable': 'select_type' 'click .pop-selectable': 'select_type'
'click .pop-selected': 'show_selectable_types' 'click .pop-selected': 'show_selectable_types'
'focus textarea': 'show_controls'
'blur textarea': 'hide_controls'
constructor: -> constructor: ->
super super
@ -466,6 +473,15 @@ class Edit extends App.Controller
@type = type @type = type
typeIcon.addClass @type typeIcon.addClass @type
show_controls: =>
@el.addClass('mode--edit')
# scroll to bottom
@el.scrollParent().scrollTop(99999)
hide_controls: =>
if !@el.find('textarea').val()
@el.removeClass('mode--edit')
autosaveStop: => autosaveStop: =>
@clearInterval( 'autosave' ) @clearInterval( 'autosave' )

View file

@ -2,6 +2,7 @@
<div class="bubble-grid horizontal"> <div class="bubble-grid horizontal">
<div class="vertical center"> <div class="vertical center">
<div class="avatar user-popover" data-id="<%= @S('id') %>" style="background-image: url(<%- @S('image') %>)"></div> <div class="avatar user-popover" data-id="<%= @S('id') %>" style="background-image: url(<%- @S('image') %>)"></div>
<div class="edit-controls">
<div class="dark pop-select"> <div class="dark pop-select">
<div class="pop-selected clickable centered"> <div class="pop-selected clickable centered">
<div class="gray <%- @type %> channel icon"></div> <div class="gray <%- @type %> channel icon"></div>
@ -29,6 +30,7 @@
<div class="internal visibility icon"></div> <div class="internal visibility icon"></div>
</div> </div>
</div> </div>
</div>
<div class="flex article-content bubble-gap"> <div class="flex article-content bubble-gap">
<div class="internal-border"> <div class="internal-border">
<div class="text-bubble"> <div class="text-bubble">
@ -37,7 +39,7 @@
<span class="bubble-placeholder">Antwort eingeben oder <span class="highlight">Dateien wählen</span></span> <span class="bubble-placeholder">Antwort eingeben oder <span class="highlight">Dateien wählen</span></span>
</div> </div>
</div> </div>
<button type="submit" class="btn btn-primary submit"><%- @T( 'Send' ) %></button> <button type="submit" class="edit-controls btn btn-primary submit"><%- @T( 'Send' ) %></button>
</div> </div>
</div> </div>
</form> </form>

View file

@ -1637,7 +1637,7 @@ footer {
.btn { .btn {
font-size: 14px; font-size: 14px;
padding: 9px 14px; padding: 9px 24px 8px;
} }
.btn.primary, .btn.primary,
@ -2580,45 +2580,6 @@ footer {
border-color: hsl(300,43%,84%); border-color: hsl(300,43%,84%);
} }
.ticket-edit .text-bubble {
padding: 0;
border-color: #b3b3b3;
white-space: normal;
border-radius: 5px;
}
.ticket-edit textarea {
width: 100%;
height: 38px;
padding: 10px 20px;
vertical-align: bottom;
border: none;
background: none;
outline: none;
transition: 500ms;
}
.ticket-edit textarea:focus {
height: 105px;
}
.ticket-edit textarea:focus + .bubble-placeholder {
display: none;
}
.ticket-edit .bubble-arrow:after {
border-color: #b3b3b3;
box-shadow: none;
}
.bubble-placeholder {
position: absolute;
color: #b3b3b3;
left: 20px;
top: 10px;
pointer-events: none;
}
.bubble-arrow { .bubble-arrow {
position: absolute; position: absolute;
width: 7px; width: 7px;
@ -2692,6 +2653,10 @@ footer {
margin-bottom: 37px; margin-bottom: 37px;
} }
.ticket-edit.mode--edit {
margin-bottom: 12px;
}
.bottom-form { .bottom-form {
background: white; background: white;
} }
@ -2711,6 +2676,14 @@ footer {
margin-bottom: 3px; margin-bottom: 3px;
} }
.ticket-edit .edit-controls {
display: none;
}
.ticket-edit.mode--edit .edit-controls {
display: block;
}
.ticket-edit .pop-selectable .icon { .ticket-edit .pop-selectable .icon {
opacity: 0.3; opacity: 0.3;
pointer-events: none; pointer-events: none;
@ -2749,6 +2722,44 @@ footer {
display: none; display: none;
} }
.ticket-edit .text-bubble {
padding: 0;
border-color: #b3b3b3;
white-space: normal;
border-radius: 5px;
}
.ticket-edit textarea {
width: 100%;
height: 38px;
padding: 10px 20px;
vertical-align: bottom;
border: none;
background: none;
outline: none;
}
.ticket-edit.mode--edit textarea {
height: 115px;
}
.ticket-edit.mode--edit .bubble-placeholder {
display: none;
}
.ticket-edit .bubble-arrow:after {
border-color: #b3b3b3;
box-shadow: none;
}
.bubble-placeholder {
position: absolute;
color: #b3b3b3;
left: 20px;
top: 10px;
pointer-events: none;
}
.pop-select { .pop-select {
position: relative; position: relative;
z-index: 2; z-index: 2;
@ -2762,7 +2773,7 @@ footer {
.pop-selected, .pop-selected,
.pop-selectable { .pop-selectable {
width: 36px; width: 38px;
height: 36px; height: 36px;
} }