MadCap Flare for Programmers by Tregner Thomas & Owens David

MadCap Flare for Programmers by Tregner Thomas & Owens David

Author:Tregner, Thomas & Owens, David
Language: eng
Format: epub
Tags: technical writing, online help
ISBN: 978-1-937434-26-7
Publisher: XML Press
Published: 2015-06-23T04:00:00+00:00


7.1.2. Connecting Toolbar functions to other actions

You can connect Toolbar functions to more than buttons. Toolbar JavaScript is just a means of defining a script to be included in the output. Remember that when we first added the “Hello World!” function to the Toolbar JavaScript, we didn’t wire it up to a button. You have other options. For example, if you add the code in Example 7.1 to the Toolbar JavaScript, it will add functionality to the search field that clears any text in the field when you press the escape key.

Example 7.1 – JavaScript to add keyup behavior for the search field

window.onload = function() { $("#search-field").keyup(function (e) { if (e.keyCode == 27) { $("#search-field").val(""); } }); }



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.