Skip to content
Browse files

fixes for link plugin and the repo browser

  • Loading branch information...
1 parent 44bd70e commit ca706f8ef3fbc3d5c7aa45cd2cfb852577519d05 @cprerovsky cprerovsky committed Nov 14, 2011
Showing with 16 additions and 17 deletions.
  1. +4 −1 CHANGELOG.md
  2. +6 −15 src/plugins/common/link/lib/link-plugin.js
  3. +6 −1 src/plugins/extra/browser/lib/browser.js
View
5 CHANGELOG.md
@@ -19,10 +19,13 @@ This document is to serve as a "what has been done" in terms of the [Roadmap](ht
- fixed handling of external links. Previously it was not possible to change a repository link to an external link.
- 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.
- fixed: autosuggest sometimes left fragments on the screen when closing the autosuggest field early.
+ - <b>NOTE</b> the default behaviour for the link plugin has changed. Links with empty hrefs will not be removed automatically any longer - removing the current href has to be confirmed by pressing enter to delete the link itself. Use the unlink button to remove the link directly.
- listenforcer-plugin: fixed a bug which would cause an error when activating or deactivating an editable
- listenforcer-plugins: Fixed a possible jquery error within the listforcer plugin. Previously this plugin was not requiring aloha using require.js. This was now corrected.
- format-plugin: tags removed by the "remove format" button may now be configured by setting Aloha.settings.plugins.format.removeFormats = ['b', 'strong', 'whatever']; The default set of formats to be removed is: 'strong', 'em', 'b', 'i', 'cite', 'q', 'code', 'abbr', 'del', 'sub', 'sup'
-- browser-plugin: The browser now supports i18n and has better paging support, if the repositories provides meta information (numItems, hasMoreItems)
+- browser-plugin
+ - The browser now supports i18n and has better paging support, if the repositories provides meta information (numItems, hasMoreItems)
+ - fixed a bug with the paging algorithm when jumping to the last page
- sidebar: The sidebar can now be disabled using the Aloha.settings.sidebar.disabled flag.
- core: added +Aloha.ready( function() {} )+
- core: Aloha base url is now auto-detected
View
21 src/plugins/common/link/lib/link-plugin.js
@@ -490,19 +490,7 @@ define( [
}
}
} );
-
- // on blur check if href is empty. If so remove the a tag
- this.hrefField.addListener( 'blur', function ( obj, event ) {
- var hrefValue = jQuery( that.hrefField.extButton.el.dom ).attr( 'value' );
- //checks for either a literal value in the href field
- //(that is not the pre-filled "http://") or a resource
- //(e.g. in the case of a repository link)
- if ( ( ! this.getValue() || this.getValue() == 'http://' )
- && ! this.getItem() ) {
- that.removeLink( false );
- }
- } );
-
+
jQuery( document )
.keydown( function ( e ) {
Aloha.Log.debug( that, 'Meta key down.' );
@@ -514,7 +502,7 @@ define( [
that.updateMousePointer();
} );
},
-
+
/**
* Updates the mouse pointer
*/
@@ -615,11 +603,14 @@ define( [
},
/**
- * Remove an a tag.
+ * Remove an a tag and clear the current item from the hrefField
*/
removeLink: function ( terminateLinkScope ) {
var range = Aloha.Selection.getRangeObject(),
foundMarkup = this.findLinkMarkup();
+
+ // clear the current item from the href field
+ this.hrefField.setItem(null);
if ( foundMarkup ) {
// remove the link
GENTICS.Utils.Dom.removeFromDOM( foundMarkup, range, true );
View
7 src/plugins/extra/browser/lib/browser.js
@@ -850,7 +850,12 @@ var Browser = Class.extend({
this._pagingOffset = 0;
break;
case 'end':
- this._pagingOffset = this._pagingCount - this.pageSize;
+ if ((this._pagingCount % this.pageSize) === 0) {
+ // item count is exactly divisible by page size
+ this._pagingOffset = this._pagingCount - this.pageSize;
+ } else {
+ this._pagingOffset = this._pagingCount - (this._pagingCount % this.pageSize);
+ }
break;
case 'next':
this._pagingOffset += this.pageSize;

0 comments on commit ca706f8

Please sign in to comment.
Something went wrong with that request. Please try again.