app/assets/javascripts/joosy/core/helpers/view.js.coffee in joosy-1.0.0.RC4 vs app/assets/javascripts/joosy/core/helpers/view.js.coffee in joosy-1.0.0.RC5

- old
+ new

@@ -2,20 +2,26 @@ # # Rendering and string representation helpers # Joosy.helpers 'Application', -> - + @tag = (name, options={}, content='') -> content = content() if Object.isFunction(content) element = document.createElement name temp = document.createElement 'div' Object.each options, (name, value) -> element.setAttribute name, value - element.innerHTML = content + try + element.innerHTML = content + catch e + # setting innerHTML fails in the IE for elements, which cann't have children (INPUT, for ex.) + # suppress this error unless content looks valuable + throw e if content + temp.appendChild element temp.innerHTML # # Converts \n into <br/> in your text @@ -26,17 +32,17 @@ text.toString().replace /\n/g, '<br/>' # # Wraps the inline block into given template # Request template will receive the inline block as @yield parameter - # + # # Example # -# foo/baz template # != @renderWrapped 'foo/bar', -> # %b This string will be passed to 'foo/bar' # # -# foo/bar template # %h1 I'm the wrapper here! # != @yield # @renderWrapped = (template, lambda) -> - @render template, Joosy.Module.merge(this, yield: lambda()) \ No newline at end of file + @render template, Joosy.Module.merge(this, yield: lambda())