Merge lp:~michael.nelson/ubuntu-webcatalog/die-onblur-die into lp:ubuntu-webcatalog

Proposed by Michael Nelson
Status: Merged
Approved by: Anthony Lenton
Approved revision: 104
Merged at revision: 104
Proposed branch: lp:~michael.nelson/ubuntu-webcatalog/die-onblur-die
Merge into: lp:ubuntu-webcatalog
Diff against target: 14 lines (+1/-3)
1 file modified
src/webcatalog/templates/webcatalog/base.html (+1/-3)
To merge this branch: bzr merge lp:~michael.nelson/ubuntu-webcatalog/die-onblur-die
Reviewer Review Type Date Requested Status
Canonical Consumer Applications Hackers Pending
Review via email: mp+102508@code.launchpad.net

Commit message

Remove fragile js placeholder code and use placeholder attribute instead for search box.

Description of the change

*Sigh*

I didn't even realise the search was using the input's *value* as a placeholder, and using fragile JS to delete on focus etc. Replaced with simple placeholder attribute.

Again, no tests affected.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/webcatalog/templates/webcatalog/base.html'
2--- src/webcatalog/templates/webcatalog/base.html 2012-04-17 10:19:43 +0000
3+++ src/webcatalog/templates/webcatalog/base.html 2012-04-18 12:54:18 +0000
4@@ -11,9 +11,7 @@
5 <div id="search-box">
6 <form id="sitesearch" action="{% url wc-search %}" method="get">
7 <input type="text" maxlength="128" name="q" id="search-box-input"
8- value="Search for an app" title="Add some words that describe the app or the app's name."
9- onblur="if(this.value==&#039;&#039;){this.value=&#039;Type to search&#039;;}"
10- onfocus="if(this.value==&#039;Type to search&#039;){this.value=&#039;&#039;}"
11+ placeholder="Search for an app" title="Add some words that describe the app or the app's name."
12 />
13 <button type="submit" name="op" id="search-box-button"><span>go</span></button>
14 </form>

Subscribers

People subscribed via source and target branches