zafu 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,7 +1,8 @@
1
- == 0.7.2 2010-09-14
1
+ == 0.7.3 2010-09-14
2
2
 
3
3
  * Minor enhancement
4
4
  * Better processing of nested arrays in node_context.
5
+ * Support to overwrite need_ajax? method
5
6
 
6
7
  == 0.7.1 2010-09-14
7
8
 
@@ -55,4 +56,4 @@
55
56
  * Compiles 'html' with rubyless declarations.
56
57
  * Guesses main ivar from view.
57
58
  * Tries to resolve method by adding current node parameter.
58
- * Added basic conditional execution with 'else' and dummy 'if' clauses.
59
+ * Added basic conditional execution with 'else' and dummy 'if' clauses.
data/lib/zafu/info.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Zafu
2
- VERSION = '0.7.2'
2
+ VERSION = '0.7.3'
3
3
  end
4
4
 
@@ -289,6 +289,7 @@ module Zafu
289
289
  def set_dom_prefix(node = self.node)
290
290
  @name ||= unique_name
291
291
  # TODO: should rebuild descendants list in parents...
292
+ #puts [parent.method, method, @context[:name], @name].inspect
292
293
  node.dom_prefix = @name
293
294
  end
294
295
 
@@ -321,6 +322,20 @@ module Zafu
321
322
  end
322
323
  end
323
324
 
325
+ protected
326
+
327
+ def need_ajax?(each_block)
328
+ return false unless each_block
329
+ # Inline editable
330
+ each_block.descendant('edit') ||
331
+ # Ajax add
332
+ descendant('add') ||
333
+ # List is reloaded from the 'add_document' popup
334
+ descendant('add_document') ||
335
+ # We use 'each' as block instead of the declared 'block' or 'drop'
336
+ ['block', 'drop'].include?(each_block.single_child_method)
337
+ end
338
+
324
339
  private
325
340
 
326
341
  # Find a block to update on the page
@@ -358,20 +373,6 @@ module Zafu
358
373
  out helper.save_erb_to_url(template, cont[:saved_template])
359
374
  end
360
375
 
361
- def need_ajax?(each_block)
362
- return false unless each_block
363
- # Inline editable
364
- each_block.descendant('edit') ||
365
- # Ajax add
366
- descendant('add') ||
367
- # List is reloaded from the 'add_document' popup
368
- descendant('add_document') ||
369
- # We use 'each' as block to render swap
370
- (descendant('swap') && descendant('swap').parent.method != 'block') ||
371
- # We use 'each' as block instead of the declared 'block' or 'drop'
372
- ['block', 'drop'].include?(each_block.single_child_method)
373
- end
374
-
375
376
  #template = expand_block(self, :)
376
377
  #
377
378
  #if @context[:block] == self
@@ -35,18 +35,16 @@ module Zafu
35
35
  with_context(:node => node.move_to(var, node.klass.first, :query => node.opts[:query])) do
36
36
  # We pass the :query option for RubyLess resolution by using the QueryBuilder finder
37
37
 
38
+ steal_and_eval_html_params_for(@markup, @params)
38
39
  # The id set here should be used as prefix for sub-nodes to ensure uniqueness of generated DOM ids
39
40
  if node.list_context?
40
41
  # we are still in a list (example: previous context was [[Node]], current is [Node])
41
42
  else
42
43
  node.propagate_dom_scope!
43
- end
44
-
45
- steal_and_eval_html_params_for(@markup, @params)
46
44
 
47
- if need_dom_id?
48
- set_dom_prefix
49
- @markup.set_id(node.dom_id)
45
+ if need_dom_id?
46
+ @markup.set_id(node.dom_id)
47
+ end
50
48
  end
51
49
 
52
50
  out wrap(expand_with)
data/zafu.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{zafu}
8
- s.version = "0.7.2"
8
+ s.version = "0.7.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Gaspard Bucher"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- - 2
9
- version: 0.7.2
8
+ - 3
9
+ version: 0.7.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Gaspard Bucher