fixed reshare with filters

This commit is contained in:
danielvincent 2011-01-07 19:15:09 -08:00
parent cadba3f2b7
commit 9cf1f5a023
4 changed files with 15 additions and 5 deletions

View file

@ -47,8 +47,10 @@ module ApplicationHelper
def aspect_links aspects, opts={} def aspect_links aspects, opts={}
str = "" str = ""
aspects.each do |a| aspects.each do |aspect|
str << aspect_li(a, opts) str << '<li>'
str << link_for_aspect(aspect, :params => opts, 'data-guid' => aspect.id, :class => 'hard_aspect_link').html_safe
str << '</li>'
end end
str.html_safe str.html_safe
end end

View file

@ -4,7 +4,10 @@
module AspectsHelper module AspectsHelper
def link_for_aspect(aspect, opts={}) def link_for_aspect(aspect, opts={})
link_to aspect.name, aspects_path("a_ids[]" => aspect.id), opts opts[:params] ||= {}
opts[:params] = opts[:params].merge("a_ids[]" => aspect.id)
link_to aspect.name, aspects_path( opts[:params] ), opts
end end
def remove_link(aspect) def remove_link(aspect)

View file

@ -3,7 +3,7 @@
-# the COPYRIGHT file. -# the COPYRIGHT file.
#publisher{:class => ("closed" unless params[:op])} #publisher{:class => ("closed" unless params[:op] || params[:prefill])}
#click_to_share #click_to_share
= image_tag 'icons/doc_edit.png' = image_tag 'icons/doc_edit.png'

View file

@ -111,8 +111,13 @@ $(document).ready(function(){
// fill in publisher // fill in publisher
// (not cached because this element changes) // (not cached because this element changes)
$("#publisher textarea").val(post);
var textarea = $("#publisher textarea");
if( textarea.val() == "" ) {
textarea.val(post);
textarea.focus();
}
$('html, body').animate({scrollTop:0}, 'fast'); $('html, body').animate({scrollTop:0}, 'fast');
// reinit listeners on stream // reinit listeners on stream