Skip to content

Commit 8f68065

Browse files
committedApr 4, 2012
moved tabs in to actual header markup as they should be. working on scrolling form browser window and not inner divs
1 parent 6a23273 commit 8f68065

File tree

8 files changed

+57
-48
lines changed

8 files changed

+57
-48
lines changed
 

‎app/assets/javascripts/backbone/helpers/channels.js.coffee

+6-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ class Kandan.Helpers.Channels
1717
scrollPercentage > @options.autoScrollThreshold
1818

1919
@scrollToLatestMessage: (channelId)->
20-
@channel_activities_el(channelId).parent().scrollTop(100000)
20+
console.log("scrolling to last message");
21+
$('document').scrollTop($('docoument').height())
22+
#@channel_activities_el(channelId).parent().scrollTop(100000)
2123

2224
@currentScrollPosition: (channelId)->
23-
@channel_activities_el(channelId).parent().scrollTop()
25+
console.log("current scroll position");
26+
$('document').scrollTop()
27+
#@channel_activities_el(channelId).parent().scrollTop()
2428

2529
@channel_activities_el: (channelId)->
2630
$("#channel-activities-#{channelId}")

‎app/assets/javascripts/backbone/kandan.js.coffee

+2-4
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,14 @@ window.Kandan =
3737
window.broadcaster.subscribe "/channels/*"
3838

3939
initTabs: ()->
40-
$('#channels').tabs({
41-
create: (event, ui)->
42-
$('ul.ui-tabs-nav').css({top: $('.header').offset().top + "px"})
40+
$('#kandan').tabs({
4341
select: (event, ui)->
4442
$(document).data('active_channel_id',
4543
Kandan.Helpers.Channels.getChannelIdByTabIndex(ui.index))
4644
Kandan.Data.Channels.runCallbacks('change')
4745
})
4846

49-
$("#channels").tabs 'option', 'tabTemplate', '''
47+
$("#kandan").tabs 'option', 'tabTemplate', '''
5048
<li>
5149
<span class="tab_right"></span>
5250
<span class="tab_left"></span>

‎app/assets/javascripts/backbone/views/chatarea.js.coffee

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Kandan.Views.ChatArea extends Backbone.View
88
"click .create_channel": "createChannel"
99

1010
render: ->
11-
$(@el).html(@template({channels: @options.channels}))
11+
$('.header .logo').after(@template({channels: @options.channels}))
1212
for channel in @options.channels.models
1313
view = new Kandan.Views.ChannelPane({channel: channel})
1414
$(@el).append(view.render().el)
@@ -29,4 +29,4 @@ class Kandan.Views.ChatArea extends Backbone.View
2929
deleteChannel: (event)->
3030
channelIndex = $(event.target).parent().prevAll().length
3131
console.log "request for deletion", channelIndex
32-
Kandan.Helpers.Channels.deleteChannelByTabIndex(channelIndex) if channelIndex != 0
32+
Kandan.Helpers.Channels.deleteChannelByTabIndex(channelIndex) if channelIndex != 0

‎app/assets/stylesheets/_base.sass

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@
55
*
66
+box-sizing(border-box)
77

8+
#kandan
9+
height: 100%
10+
width: 100%
11+
812
.header
913
display: block
10-
height: $header-height
1114
width: 100%
1215
position: fixed
16+
height: $header-height
1317
top: 0
1418
background-color: $header-bg-1
1519
+background-image(linear-gradient($header-bg-1, $header-bg-2))
@@ -53,6 +57,7 @@
5357
/* gotta bump stuff in the header
5458
.logo, .ui-tabs-nav
5559
padding-top: 7px !important
60+
float: left
5661
.search form
5762
padding-top: 5px
5863

‎app/assets/stylesheets/_chat_area.sass

+13-16
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
margin-top: 0px
33

44
.ui-widget-header
5-
+background-image(linear-gradient($header-bg-1, $header-bg-2))
5+
background: transparent !important
66
+border-radius(0px)
77
border: none
88
.ui-state-active
@@ -23,28 +23,23 @@ html body .ui-tabs .ui-tabs-nav li
2323
.create_channel
2424
cursor: hover
2525

26-
body html ul.ui-tabs-nav
27-
display: block
28-
width: 1050px
29-
height: 32px
26+
.ui-tabs-nav
3027

3128

32-
/* html body #app_body .main-area #channels li.ui-state-active
33-
/* backgroun-color: $active-tab-bg !important
34-
35-
/* html body li.ui-state-default
36-
/* background-color: #9da7aa !important
37-
3829
.ui-tabs
3930
+border-radius(0px)
4031
padding: 0px
4132
margin-top: 0px
4233
border: none
4334
.ui-tabs-nav
44-
position: fixed
45-
top: 0px
46-
left: 90px
4735
z-index: 20
36+
display: block
37+
position: absolute
38+
bottom: 0px
39+
float: left
40+
padding: 0px !important
41+
margin-left: 80px
42+
margin-bottom: 1px !important
4843
li a
4944
font-size: 14px
5045
.ui-state-default
@@ -83,13 +78,13 @@ body html ul.ui-tabs-nav
8378
.paginated-activities
8479
+box-shadow(5px 0px 5px -3px #cccccc, -5px 0px 5px -3px #cccccc, 5px 10px 5px -3px #cccccc, -5px 10px 5px -3px #cccccc)
8580
+border-top-radius(4px)
86-
overflow-y: scroll
8781
float: left
8882
width: 100%
8983
min-height: 88%
9084
height: 88%
9185
background: #FFF
9286
padding: 10px
87+
padding-bottom: 72px
9388
.pagination
9489
text-decoration: underline
9590
cursor: pointer
@@ -103,7 +98,9 @@ body html ul.ui-tabs-nav
10398
float: left
10499
border-top: 1px solid #EBEFF1
105100
padding: 10px 0px 10px 10px
106-
width: 100%
101+
width: 77%
102+
position: fixed
103+
bottom: 0px
107104
textarea
108105
+border-top-left-radius(4px)
109106
+border-bottom-left-radius(4px)

‎app/assets/stylesheets/_sidebar.sass

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
.sidebar
2+
padding-top: $header-height + 20
3+
position: fixed
4+
top: 0px
5+
right: 0px
26
min-height: 100%
37
height: 100%
48
width: $sidebar-width

‎app/views/main/index.html.erb

+23-22
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,32 @@
66

77

88

9-
10-
<div class="header">
11-
<%= image_tag "logo.png", :class=>"logo" %>
12-
13-
<a href="#" class="user_menu_link">
14-
<cite class="user_flag"></cite>
15-
<div class="user"></div>
16-
</a>
17-
18-
<div class="user_menu">
19-
<a href="<%= destroy_user_session_path %>">logout</a>
9+
<div id="kandan">
10+
<div class="header">
11+
<%= image_tag "logo.png", :class=>"logo" %>
12+
13+
<a href="#" class="user_menu_link">
14+
<cite class="user_flag"></cite>
15+
<div class="user"></div>
16+
</a>
17+
18+
<div class="user_menu">
19+
<a href="<%= destroy_user_session_path %>">logout</a>
20+
</div>
21+
22+
<div class="search">
23+
<form method="get" action="/search" target="_blank">
24+
<input type="text" class="query" name="query"/>
25+
</form>
26+
</div>
2027
</div>
2128

22-
<div class="search">
23-
<form method="get" action="/search" target="_blank">
24-
<input type="text" class="query" name="query"/>
25-
</form>
26-
</div>
27-
</div>
28-
29-
<div id="app_body">
30-
<div class="main-area"></div>
29+
<div id="app_body">
30+
<div class="main-area"></div>
3131

32-
<div class="sidebar">
33-
<div class="widgets"></div>
32+
<div class="sidebar">
33+
<div class="widgets"></div>
34+
</div>
3435
</div>
3536
</div>
3637

‎config/kandan_settings.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
:broadcaster:
99
:name: "Faye"
1010

11-
:per_page: 5
11+
:per_page: 30

0 commit comments

Comments
 (0)
Please sign in to comment.