add comment for searchField javascript

This commit is contained in:
Greg Weber 2011-08-31 05:37:46 -07:00
parent d7a29448d9
commit 130363e9d4

View File

@ -292,6 +292,7 @@ searchField autoFocus = Field
<input id="#{theId}" name="#{name}" type="search" :isReq:required="" :autoFocus:autofocus="" value="#{either id id val}"> <input id="#{theId}" name="#{name}" type="search" :isReq:required="" :autoFocus:autofocus="" value="#{either id id val}">
|] |]
when autoFocus $ do when autoFocus $ do
-- we want this javascript to be placed immediately after the field
[WHAMLET|\<script>if (!('autofocus' in document.createElement('input'))) {document.getElementById('#{theId}').focus();}</script> [WHAMLET|\<script>if (!('autofocus' in document.createElement('input'))) {document.getElementById('#{theId}').focus();}</script>
|] |]
addCassius [CASSIUS| addCassius [CASSIUS|