Skip to content

Commit 1fa42d5

Browse files
committed
fix: make user_src_input generate valid javascript
user_src_input used to generate False if edit_ok == False in this statement: tal:attributes="onblur python:edit_ok and 'split_name(this)'; but False isn't a boolean in javascript, so it throws an error in the console. Changed to use: tal:attributes="onblur python:'split_name(this)' if edit_ok else ''; which generates an empty onblur if the field is not editable.
1 parent 8e915d1 commit 1fa42d5

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

share/roundup/templates/classic/html/page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ <h2><span metal:define-slot="body_title">body title</span></h2>
369369

370370
<!-- src: value will be re-used for other input fields -->
371371
<input metal:define-macro="user_src_input"
372-
type="text" tal:attributes="onblur python:edit_ok and 'split_name(this)';
372+
type="text" tal:attributes="onblur python:'split_name(this)' if edit_ok else '';
373373
id name; name name; value value; readonly not:edit_ok"
374374
value="heinz.kunz">
375375
<!-- normal: no re-using -->

share/roundup/templates/devel/html/page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ <h1 id="breadcrumb"><span metal:define-slot="body_title">body title</span></h1>
424424

425425
<!-- src: value will be re-used for other input fields -->
426426
<input metal:define-macro="user_src_input"
427-
type="text" tal:attributes="onblur python:edit_ok and 'split_name(this)';
427+
type="text" tal:attributes="onblur python:'split_name(this)' if edit_ok else '';
428428
id name; name name; value value; readonly not:edit_ok"
429429
value="heinz.kunz"/>
430430
<!-- normal: no re-using -->

share/roundup/templates/minimal/html/page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ <h2><span metal:define-slot="body_title">body title</span></h2>
331331

332332
<!-- src: value will be re-used for other input fields -->
333333
<input metal:define-macro="user_src_input"
334-
type="text" tal:attributes="onblur python:edit_ok and 'split_name(this)';
334+
type="text" tal:attributes="onblur python:'split_name(this)' if edit_ok else '';
335335
id name; name name; value value; readonly not:edit_ok"
336336
value="heinz.kunz">
337337
<!-- normal: no re-using -->

share/roundup/templates/responsive/html/page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ <h1><span metal:define-slot="body_title">body title</span></h1>
439439

440440
<!-- src: value will be re-used for other input fields -->
441441
<input metal:define-macro="user_src_input"
442-
type="text" tal:attributes="onblur python:edit_ok and 'split_name(this)';
442+
type="text" tal:attributes="onblur python:'split_name(this)' if edit_ok else '';
443443
id name; name name; value value; readonly not:edit_ok"
444444
value="heinz.kunz"/>
445445
<!-- normal: no re-using -->

0 commit comments

Comments
 (0)