• R/O
  • SSH
  • HTTPS

tenarai: 提交


Commit MetaInfo

修訂117 (tree)
時間2008-09-15 11:14:57
作者junkikuchi

Log Message

updated.

Change Summary

差異

--- trunk/lib/tenarai/container.rb (revision 116)
+++ trunk/lib/tenarai/container.rb (revision 117)
@@ -40,6 +40,10 @@
4040 !assoc(key).nil?
4141 end
4242
43+ def delete(key)
44+ super(assoc(key))
45+ end
46+
4347 def each(&block)
4448 super do |key, val|
4549 block.call(val)
--- trunk/webapp/Widget/Widget/CSS.rb (revision 116)
+++ trunk/webapp/Widget/Widget/CSS.rb (revision 117)
@@ -171,10 +171,17 @@
171171 end
172172
173173 def post(query={})
174- resource.content.css.clear
174+ css = resource.content.css
175+
175176 query.each do |key, val|
176- unless val.empty?
177- resource.content.css << Tenarai::Container::Value.new(key, val)
177+ if val.empty?
178+ css.delete(key)
179+ else
180+ if css.key?(key)
181+ css.fetch(key).value = val
182+ else
183+ css << Tenarai::Container::Value.new(key, val)
184+ end
178185 end
179186 end
180187 resource.content.save
Show on old repository browser