jquery.textcomplete update to v1.3.4

pull/3010/head
rabuzarus 2016-04-29 14:31:09 +02:00 committed by Roland Haeder
parent a96d7bdd0b
commit 31a30fc310
No known key found for this signature in database
GPG Key ID: B72F8185C6C7BD78
5 changed files with 26 additions and 27 deletions

View File

@ -8,6 +8,10 @@ This change log adheres to [keepachangelog.com](http://keepachangelog.com).
## [Unreleased]
## [1.3.4] - 2016-04-20
### Fixed
- Fix endless loop when RTL ([#247](https://github.com/yuku-t/jquery-textcomplete/pull/247))
## [1.3.3] - 2016-04-04
### Fixed
- Fix uncaught TypeError.
@ -283,7 +287,8 @@ This change log adheres to [keepachangelog.com](http://keepachangelog.com).
### Added
- Initial release.
[Unreleased]: https://github.com/yuku-t/jquery-textcomplete/compare/v1.3.3...HEAD
[Unreleased]: https://github.com/yuku-t/jquery-textcomplete/compare/v1.3.4...HEAD
[1.3.4]: https://github.com/yuku-t/jquery-textcomplete/compare/v1.3.3...v1.3.4
[1.3.3]: https://github.com/yuku-t/jquery-textcomplete/compare/v1.3.2...v1.3.3
[1.3.2]: https://github.com/yuku-t/jquery-textcomplete/compare/v1.3.1...v1.3.2
[1.3.1]: https://github.com/yuku-t/jquery-textcomplete/compare/v1.3.0...v1.3.1

View File

@ -1,5 +1,4 @@
Autocomplete for Textarea
=========================
# Autocomplete for Textarea
[![npm version](https://badge.fury.io/js/jquery-textcomplete.svg)](http://badge.fury.io/js/jquery-textcomplete)
[![Bower version](https://badge.fury.io/bo/jquery-textcomplete.svg)](http://badge.fury.io/bo/jquery-textcomplete)
@ -11,8 +10,7 @@ Introduces autocompleting power to textareas, like a GitHub comment form has.
[Demo](http://yuku-t.com/jquery-textcomplete/).
Synopsis
--------
## Synopsis
```js
$('textarea').textcomplete([{
@ -29,25 +27,19 @@ $('textarea').textcomplete([{
}]);
```
Dependencies
------------
## Dependencies
- jQuery (>= 1.7.0) OR Zepto (>= 1.0)
Documents
---------
## Documents
See [doc](https://github.com/yuku-t/jquery-textcomplete/tree/master/doc) dir.
License
-------
## License
Licensed under the MIT License.
Credits
-------
### Contributors
## Contributors
Patches and code improvements were contributed by:

View File

@ -795,8 +795,14 @@ if (typeof jQuery === 'undefined') {
// (which makes our elements wrap onto the next line and corrupt the next item), if we're close to the right
// edge, move left. We don't know how far to move left, so just keep nudging a bit.
var tolerance = 30; // pixels. Make wider than vertical scrollbar because we might not be able to use that space.
while (this.$el.offset().left + this.$el.width() > $window.width() - tolerance) {
this.$el.offset({left: this.$el.offset().left - tolerance});
var lastOffset = this.$el.offset().left, offset;
var width = this.$el.width();
var maxLeft = $window.width() - tolerance;
while (lastOffset + width > maxLeft) {
this.$el.offset({left: lastOffset - tolerance});
offset = this.$el.offset().left;
if (offset >= lastOffset) { break; }
lastOffset = offset;
}
},
@ -1266,7 +1272,7 @@ if (typeof jQuery === 'undefined') {
//
// https://github.com/component/textarea-caret-position
(function () {
(function ($) {
// The properties that we copy into a mirrored div.
// Note that some browsers, such as Firefox,
@ -1387,13 +1393,9 @@ function getCaretCoordinates(element, position, options) {
return coordinates;
}
if (typeof module != 'undefined' && typeof module.exports != 'undefined') {
module.exports = getCaretCoordinates;
} else if(isBrowser){
window.$.fn.textcomplete.getCaretCoordinates = getCaretCoordinates;
}
$.fn.textcomplete.getCaretCoordinates = getCaretCoordinates;
}());
}(jQuery));
return jQuery;
}));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long