Permalink
Browse files

moved extjs bug workaround from ui-attributefield to link-plugin.js a…

…s we discovered that the implemented workaround will severly hurt enter handling when implemented in the attribute field
  • Loading branch information...
1 parent 1b326e9 commit 69e1ac943e2360cc6346a64b968bcce830d28d42 @cprerovsky cprerovsky committed Nov 11, 2011
Showing with 28 additions and 22 deletions.
  1. +4 −0 CHANGELOG.md
  2. +0 −21 src/lib/aloha/ui-attributefield.js
  3. +24 −1 src/plugins/common/link/lib/link-plugin.js
View
@@ -81,8 +81,12 @@ This document is to serve as a "what has been done" in terms of the [Roadmap](ht
An issue was created for a replacement of the genericcontenthandler for the initialization of editables:
https://github.com/alohaeditor/Aloha-Editor/issues/348
+
- FloatingMenu
The FloatingMenu now accepts the Aloha.settings.floatingmenu.topalignOffset setting, which will define the vertical offset to the editable when the "topalign" behavior is used. The default value is 90px, so if you activate the FloatingMenu's topalign behaviour the FloatingMenu will hover 90px above the currently active editable. Switch it to any meaningful integer offset you prefer.
+
+- Fixed: link-plugin
+ initially clicking on an existing link before the link tab has been rendered would leave you with an empty href field. This is actually an ExtJS issue, which has been workarounded.
## 0.10.-0.19.0
The reason for not releasing this builds was the ongoing refactoring of the core engine to implement all functionallities based on execCommand.
@@ -68,8 +68,6 @@ Ext.ux.AlohaAttributeField = Ext.extend(Ext.form.ComboBox, {
listEmptyText: i18n.t( 'repository.no_item_found' ),
loadingText: i18n.t( 'repository.loading' ) + '...',
enableKeyEvents: true,
- hrefUpdateInt: null,
- hrefUpdateObj: null,
store: new Ext.data.Store({
proxy: new Ext.data.AlohaProxy(),
reader: new Ext.data.AlohaObjectReader()
@@ -260,25 +258,6 @@ Ext.ux.AlohaAttributeField = Ext.extend(Ext.form.ComboBox, {
that.setItem(items[0]);
}
});
-
- // if the selection-changed event was raised by the first click interaction on this page
- // the hrefField component might not be initialized. When the user switches to the link
- // tab to edit the link the field would be empty. We check for that situation and add a
- // special interval check to set the value once again
- if ( jQuery('#' + this.id).length === 0 ) {
- // there must only be one update interval running at the same time
- if ( this.hrefUpdateInt !== null) {
- clearInterval( this.hrefUpdateInt );
- }
-
- // register a timeout that will set the value as soon as the href field was initialized
- this.hrefUpdateInt = setInterval(function () {
- if( jQuery('#' + that.id).length > 0 ) { // the object was finally created
- that.setTargetObject( obj, attr );
- clearInterval( that.hrefUpdateInt );
- }
- }, 200);
- }
},
getTargetObject : function () {
return this.targetObject;
@@ -37,7 +37,6 @@ define( [
isAutoCompleteEnabled = true;
return Plugin.create( 'link', {
-
/**
* Configure the available languages
*/
@@ -90,6 +89,11 @@ define( [
ignoreNextSelectionChangedEvent: false,
/**
+ * Internal update interval reference to work around an ExtJS bug
+ */
+ hrefUpdateInt: null,
+
+ /**
* Initialize the plugin
*/
init: function () {
@@ -278,6 +282,25 @@ define( [
that.formatLinkButton.setPressed( true );
FloatingMenu.setScope( 'link' );
that.hrefField.setTargetObject( foundMarkup, 'href' );
+
+ // if the selection-changed event was raised by the first click interaction on this page
+ // the hrefField component might not be initialized. When the user switches to the link
+ // tab to edit the link the field would be empty. We check for that situation and add a
+ // special interval check to set the value once again
+ if ( jQuery('#' + that.hrefField.extButton.id).length === 0 ) {
+ // there must only be one update interval running at the same time
+ if ( that.hrefUpdateInt !== null) {
+ clearInterval( that.hrefUpdateInt );
+ }
+
+ // register a timeout that will set the value as soon as the href field was initialized
+ that.hrefUpdateInt = setInterval(function () {
+ if( jQuery('#' + that.hrefField.extButton.id).length > 0 ) { // the object was finally created
+ that.hrefField.setTargetObject( foundMarkup, 'href' );
+ clearInterval( that.hrefUpdateInt );
+ }
+ }, 200);
+ }
} else {
that.formatLinkButton.setPressed( false );
that.hrefField.setTargetObject( null );

0 comments on commit 69e1ac9

Please sign in to comment.