inverse toggle effects + add missing redirect_url field + fix an anoying bug about the locomotive_media plugin
This commit is contained in:
parent
a6211d594e
commit
c267f8ccbc
@ -24,13 +24,15 @@ class Locomotive.Views.ContentAssets.PickerView extends Locomotive.Views.Shared.
|
|||||||
success: (model) => @collection.add(model)
|
success: (model) => @collection.add(model)
|
||||||
error: (msg) => @shake()
|
error: (msg) => @shake()
|
||||||
|
|
||||||
add_asset: (asset) ->
|
add_asset: (asset, first) ->
|
||||||
view = new Locomotive.Views.ContentAssets.PickerItemView model: asset, parent: @
|
view = new Locomotive.Views.ContentAssets.PickerItemView model: asset, parent: @
|
||||||
|
|
||||||
(@_item_views ||= []).push(view)
|
(@_item_views ||= []).push(view)
|
||||||
@$('ul.list .clear').before(view.render().el)
|
@$('ul.list .clear').before(view.render().el)
|
||||||
|
|
||||||
@_refresh() & @_move_to_last_asset()
|
@_refresh()
|
||||||
|
|
||||||
|
@_move_to_last_asset() unless first == true
|
||||||
|
|
||||||
remove_asset: (asset) ->
|
remove_asset: (asset) ->
|
||||||
view = _.find @_item_views, (tmp) -> tmp.model == asset
|
view = _.find @_item_views, (tmp) -> tmp.model == asset
|
||||||
|
@ -110,6 +110,10 @@ class Locomotive.Views.Pages.FormView extends Locomotive.Views.Shared.FormView
|
|||||||
enable_redirect_checkbox: ->
|
enable_redirect_checkbox: ->
|
||||||
@_enable_checkbox 'redirect',
|
@_enable_checkbox 'redirect',
|
||||||
features: ['templatized', 'cache_strategy']
|
features: ['templatized', 'cache_strategy']
|
||||||
|
on_callback: =>
|
||||||
|
@$('li#page_redirect_url_input').show()
|
||||||
|
off_callback: =>
|
||||||
|
@$('li#page_redirect_url_input').hide()
|
||||||
|
|
||||||
enable_other_checkboxes: ->
|
enable_other_checkboxes: ->
|
||||||
_.each ['published', 'listed'], (exp) =>
|
_.each ['published', 'listed'], (exp) =>
|
||||||
|
@ -48,7 +48,7 @@ class Locomotive.Views.Shared.AssetPickerView extends Backbone.View
|
|||||||
|
|
||||||
@build_uploader(el, link)
|
@build_uploader(el, link)
|
||||||
|
|
||||||
actions.find('.upload-button-wrapper').hover(
|
actions.find('.button-wrapper').hover(
|
||||||
=> link.addClass('hover'),
|
=> link.addClass('hover'),
|
||||||
=> link.removeClass('hover')
|
=> link.removeClass('hover')
|
||||||
)
|
)
|
||||||
@ -69,14 +69,15 @@ class Locomotive.Views.Shared.AssetPickerView extends Backbone.View
|
|||||||
$(@el).dialog('option', 'position', 'center')
|
$(@el).dialog('option', 'position', 'center')
|
||||||
|
|
||||||
add_assets: (collection) ->
|
add_assets: (collection) ->
|
||||||
collection.each @add_asset
|
collection.each (asset) =>
|
||||||
|
@add_asset(asset, true)
|
||||||
|
|
||||||
@_refresh()
|
@_refresh()
|
||||||
|
|
||||||
setTimeout (=> @create_dialog()), 30 # disable flickering
|
setTimeout (=> @create_dialog()), 30 # disable flickering
|
||||||
|
|
||||||
add_asset: (asset) ->
|
add_asset: (asset, first) ->
|
||||||
# please overide add_asset
|
# please overide add_asset (the 'first' param is to know if it comes from the first collection fetch)
|
||||||
|
|
||||||
remove_asset: (asset) ->
|
remove_asset: (asset) ->
|
||||||
# please overide remove_asset
|
# please overide remove_asset
|
||||||
|
17
doc/TODO
17
doc/TODO
@ -1,7 +1,20 @@
|
|||||||
BOARD:
|
BOARD:
|
||||||
|
|
||||||
- namespace assets
|
x namespace assets
|
||||||
-
|
- bugs:
|
||||||
|
x toggler
|
||||||
|
x advanced options (redirect url missing)
|
||||||
|
x locomotive_media (not animating on open)
|
||||||
|
- editable_elements => view + mustache template
|
||||||
|
- editable_short_text => tinymce
|
||||||
|
- editable_image => new formtastic inputs
|
||||||
|
- create/edit page in ajax
|
||||||
|
- fix other pages
|
||||||
|
- content types
|
||||||
|
- edit my account
|
||||||
|
- create a new site
|
||||||
|
- edit my site
|
||||||
|
- theme assets
|
||||||
|
|
||||||
|
|
||||||
BACKLOG:
|
BACKLOG:
|
||||||
|
8
vendor/assets/javascripts/toggle.js
vendored
8
vendor/assets/javascripts/toggle.js
vendored
@ -57,7 +57,7 @@
|
|||||||
// if it's set to on
|
// if it's set to on
|
||||||
if(checked){
|
if(checked){
|
||||||
|
|
||||||
$(element).animate({marginLeft: '15px'}, 100,
|
$(element).animate({marginLeft: '0px'}, 100,
|
||||||
|
|
||||||
// callback function
|
// callback function
|
||||||
function(){
|
function(){
|
||||||
@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
$(element).animate({marginLeft: '0px'}, 100,
|
$(element).animate({marginLeft: '15px'}, 100,
|
||||||
|
|
||||||
// callback function
|
// callback function
|
||||||
function(){
|
function(){
|
||||||
@ -104,9 +104,9 @@
|
|||||||
|
|
||||||
// insert the new toggle markup
|
// insert the new toggle markup
|
||||||
if($(this).attr("checked") == "checked" || $(this).attr("checked") == true){
|
if($(this).attr("checked") == "checked" || $(this).attr("checked") == true){
|
||||||
$(this).after('<div class="toggleSwitch"><span class="leftLabel">'+settings.on_label+'<\/span><div class="switchArea on" style="background-color: '+settings.on_bg_color+'"><span class="switchHandle left" style="margin-left: 0em;"><\/span><\/div><span class="rightLabel" style="color:#cccccc">'+settings.off_label+'<\/span><\/div>');
|
$(this).after('<div class="toggleSwitch"><span class="leftLabel">'+settings.on_label+'<\/span><div class="switchArea on" style="background-color: '+settings.on_bg_color+'"><span class="switchHandle left" style="margin-left: 15px;"><\/span><\/div><span class="rightLabel" style="color:#cccccc">'+settings.off_label+'<\/span><\/div>');
|
||||||
}else{
|
}else{
|
||||||
$(this).after('<div class="toggleSwitch"><span class="leftLabel" style="color:#cccccc;">'+settings.on_label+'<\/span><div class="switchArea" style="background-color: '+settings.off_bg_color+'"><span class="switchHandle right" style="margin-left:15px"><\/span><\/div><span class="rightLabel">'+settings.off_label+'<\/span><\/div>');
|
$(this).after('<div class="toggleSwitch"><span class="leftLabel" style="color:#cccccc;">'+settings.on_label+'<\/span><div class="switchArea" style="background-color: '+settings.off_bg_color+'"><span class="switchHandle right" style="margin-left:0px"><\/span><\/div><span class="rightLabel">'+settings.off_label+'<\/span><\/div>');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bind the switchHandle click events to the internal toggle function
|
// Bind the switchHandle click events to the internal toggle function
|
||||||
|
8
vendor/assets/stylesheets/toggle.scss
vendored
8
vendor/assets/stylesheets/toggle.scss
vendored
@ -22,14 +22,14 @@
|
|||||||
height: 12px;
|
height: 12px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
border: 1px solid #1971af;
|
border: 1px solid #a3a3a3;
|
||||||
@include border-radius(3px);
|
@include border-radius(3px);
|
||||||
@include background-image(linear-gradient(#218bd9, #2abbf2));
|
@include background-image(linear-gradient(top, #d2d1d1, #eeeeee 20%, #f1f1f1 25%, #f1f1f1));
|
||||||
@include box-shadow(rgba(255, 255, 255, 0.8) 0px 1px 0px 0px);
|
@include box-shadow(rgba(255, 255, 255, 0.8) 0px 1px 0px 0px);
|
||||||
|
|
||||||
&.on {
|
&.on {
|
||||||
border-color: #a3a3a3;
|
border-color: #1971af;
|
||||||
@include background-image(linear-gradient(top, #d2d1d1, #eeeeee 20%, #f1f1f1 25%, #f1f1f1));
|
@include background-image(linear-gradient(#218bd9, #2abbf2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user