Permalink
Browse files

remove old code and some improvements

  • Loading branch information...
1 parent ecdf972 commit 60086b3f69d25aeb715ee609dd72a34b5d5cae08 @brentvatne committed Jul 23, 2012
View
27 app/assets/dynamic/coffeescripts/views/slide/icon_view.coffee
@@ -5,8 +5,6 @@ class SlideIconView extends Backbone.View
events:
'click': 'editSlide'
- 'click .right-button': 'moveSlideRight'
- 'click .left-button': 'moveSlideLeft'
'click .delete-button': 'deleteSlide'
template: _.template $('#slide-icon-template').html()
@@ -29,34 +27,15 @@ class SlideIconView extends Backbone.View
# navigate to new url
console.log "edit slide"
- moveSlideRight: (e) ->
- $.ajax
- type: 'POST'
- url: @slide.url() + '/move-right',
- success: => @slide.trigger('change:order')
- error: @ohShit
-
- e.preventDefault()
- e.stopPropagation()
-
- moveSlideLeft: (e) ->
- $.ajax
- type: 'POST'
- url: @slide.url() + '/move-left',
- success: => @slide.trigger('change:order')
- error: @ohShit
-
- e.preventDefault()
- e.stopPropagation()
-
deleteSlide: (e) ->
+ @remove()
@slide.destroy
- error: @ohShit
+ error: @displayDestroyFailedError
e.preventDefault()
e.stopPropagation()
- ohShit: ->
+ displayDestroyFailedError: ->
da.ui.displayNotification
type: 'error'
message: 'Uh oh that didnt work :( Try again!'
View
2 app/assets/dynamic/coffeescripts/views/slide/list_view.coffee
@@ -24,7 +24,7 @@ class SlideListView extends Backbone.View
_.each @slides.models, (slide) =>
slide.on 'reorder', @reloadSlides, this
- slide.on 'error:reorder', @render, this
+ slide.on 'error:reorder', @render, this
@$el.append (new da.views.SlideIconView(slide: slide)).el
@$el.sortable(items: '.micro-slide')
View
16 app/assets/dynamic/stylesheets/application.scss
@@ -15,7 +15,8 @@
}
.section-title {
- padding-bottom: 40px;
+ padding: 0px 10px 30px 10px;
+ vertical-align: top;
}
.slide-list {
@@ -106,10 +107,11 @@
position: absolute;
top: 0px;
left: 20px;
- transition: all 0.5s ease-in-out;
- -moz-transition: all 0.5s ease-in-out;
- -webkit-transition: all 0.5s ease-in-out;
- -o-transition: all 0.5s ease-in-out;
+ transition: all 0.4s ease-in-out;
+ -moz-transition: all 0.4s ease-in-out;
+ -webkit-transition: all 0.4s ease-in-out;
+ -o-transition: all 0.4s ease-in-out;
+
&.background {
&.one {
z-index: 999;
@@ -155,6 +157,8 @@
.short-section-title {
box-sizing: border-box;
height: 40px;
+ padding-left: 10px;
+ padding-right: 10px;
}
.slide-edit-area {
@@ -304,7 +308,7 @@ h1.sharing-with-buttons {
min-height: 200px;
position: relative;
margin: 0 auto;
- padding: 10px 50px 50px 50px;
+ padding: 10px 50px 30px 50px;
background: #FFF;
border: 1px solid #B8B8B8;
border-top: 0px;
View
3 app/assets/dynamic/stylesheets/slides.scss
@@ -40,7 +40,8 @@
box-sizing: border-box;
background-color: #F9F9FA;
border: 2px solid #F0F0F0;
- border-radius: 5px;
+ padding: 5px;
+ border-radius: 6px;
margin-right: 10px;
display: inline-block;
vertical-align: top;
View
16 app/controllers/decks_controller.rb
@@ -24,7 +24,7 @@ class App < Sinatra::Application
end
get '/api/decks', :authenticates => true do
- decks = current_user.decks.all.map do |deck|
+ decks = current_user.decks.all.reverse.map do |deck|
deck.attributes
end
@@ -44,20 +44,6 @@ class App < Sinatra::Application
deck.delete_slide(slide)
end
- post '/api/decks/:deck_id/slides/:slide_id/move-left', :authenticates => true do
- deck = current_user.decks.first(:id => params[:deck_id])
- slide = deck.slides.first(:id => params[:slide_id])
-
- deck.move_slide_left(slide)
- end
-
- post '/api/decks/:deck_id/slides/:slide_id/move-right', :authenticates => true do
- deck = current_user.decks.first(:id => params[:deck_id])
- slide = deck.slides.first(:id => params[:slide_id])
-
- deck.move_slide_right(slide)
- end
-
post '/api/decks/:deck_id/slides/:slide_id/update-position', :authenticates => true do
deck = current_user.decks.first(:id => params[:deck_id])
slide = deck.slides.first(:id => params[:slide_id])

0 comments on commit 60086b3

Please sign in to comment.