diff options
author | Madhura Jayaratne <madhura.cj@gmail.com> | 2015-05-20 06:38:49 +0300 |
---|---|---|
committer | Madhura Jayaratne <madhura.cj@gmail.com> | 2015-05-20 06:38:49 +0300 |
commit | af08e1417e7a3ae8e0df5faf8a5db2f11343e9f5 (patch) | |
tree | ab545f3a26bf2c71e2ea8b04fcefb21a0a1e4467 /js/functions.js | |
parent | 34f318e52d8f3fdb33b6d9a2fa49574b4809c89e (diff) |
bug #4911 Lock page icon is not shown after fresh reload
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
Diffstat (limited to 'js/functions.js')
-rw-r--r-- | js/functions.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/js/functions.js b/js/functions.js index 06a59a3630..d3f524c29b 100644 --- a/js/functions.js +++ b/js/functions.js @@ -4068,7 +4068,18 @@ AJAX.registerTeardown('functions.js', function () { codemirror_editor = false; } }); - +AJAX.registerOnload('functions.js', function () { + // initializes all lock-page elements lock-id and + // val-hash data property + $('#page_content form.lock-page textarea, ' + + '#page_content form.lock-page input[type="text"]').each(function (i) { + $(this).data('lock-id', i); + // val-hash is the hash of default value of the field + // so that it can be compared with new value hash + // to check whether field was modified or not. + $(this).data('val-hash', AJAX.hash($(this).val())); + }); +}); /** * jQuery plugin to cancel selection in HTML code. */ |