From 06c0fd3da81bed89e12e7a30cfc6ff33ddecd075 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Rekucki?= Date: Mon, 5 Oct 2009 13:43:36 +0200 Subject: [PATCH] Another hotkey fix. Added "History" link. --- project/static/js/views/flash.js | 7 ++++++- project/static/js/views/xml.js | 11 +++++++---- project/templates/explorer/editor.html | 8 ++++++-- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/project/static/js/views/flash.js b/project/static/js/views/flash.js index 3f4f4759..b2240e43 100644 --- a/project/static/js/views/flash.js +++ b/project/static/js/views/flash.js @@ -27,9 +27,14 @@ var FlashView = View.extend({ modelFirstFlashMessageChanged: function(property, value) { this.element.fadeOut('slow', function() { + this.element.css({'z-index': 0}); this.shownMessage = value; this.render(); - this.element.fadeIn('slow'); + + if(this.shownMessage) { + this.element.css({'z-index': 1000}); + this.element.fadeIn('slow'); + } }.bind(this)); } }); diff --git a/project/static/js/views/xml.js b/project/static/js/views/xml.js index d24dfa94..02154723 100644 --- a/project/static/js/views/xml.js +++ b/project/static/js/views/xml.js @@ -98,20 +98,23 @@ var XMLView = View.extend({ getHotkey: function(event) { var code = event.keyCode; + if(!((code >= 97 && code <= 122) + || (code >= 65 && code <= 90)) ) return null; + var ch = String.fromCharCode(code & 0xff).toLowerCase(); - var button = $('.buttontoolbarview-button[title='+ch+']', this.element)[0] + console.log(ch.charCodeAt(0), '#', buttons); - console.log(ch, '#', button); + var buttons = $('.buttontoolbarview-button[title='+ch+']', this.element); var mod = 0; if(event.altKey) mod |= 0x01; if(event.ctrlKey) mod |= 0x02; if(event.shiftKey) mod |= 0x04; - if(button) { + if(buttons.length) { var match = null; - $(button).each(function() { + buttons.each(function() { if( parseInt($(this).attr('ui:hotkey_mod')) == mod ) { match = this; return; diff --git a/project/templates/explorer/editor.html b/project/templates/explorer/editor.html index 85808f22..edb3bfcd 100644 --- a/project/templates/explorer/editor.html +++ b/project/templates/explorer/editor.html @@ -140,7 +140,11 @@ {% block breadcrumbs %}Platforma Redakcyjna > {{ fileid }}{% endblock breadcrumbs %} {% block header-toolbar %} - + Historia + + + + {% endblock %} {% block maincontent %} @@ -186,5 +190,5 @@ {% endblock maincontent %} {% block extrabody %} -
+
{% endblock %} \ No newline at end of file -- 2.20.1