Skip to content

Commit

Permalink
Now copying font related css properties to mentions underlay, to ensu…
Browse files Browse the repository at this point in the history
…re overlay is correctly positioned.
  • Loading branch information
auchenberg committed Jul 3, 2012
1 parent a4c6b6b commit 8a95226
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions jquery.mentionsInput.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/*
* Mentions Input
* Version 1.5
* Written by: Kenneth Auchenberg (Citrix Systems Inc)
* Written by: Kenneth Auchenberg
*
* Copyright (c) 2012 - Citrix Systems, Inc.
*
* Using underscore.js
*
Expand Down Expand Up @@ -112,8 +114,21 @@
},

initMentionsOverlay : function() {
this.elmMentionsOverlay = $( this.settings.templates.mentionsOverlay() );
this.elmMentionsOverlay.prependTo( this.elmWrapperBox );

// Contruct element
elmMentionsOverlay = $(settings.templates.mentionsOverlay());

// Copy CSS properties to inner <div>
var cssHash = {};
var cssProperties = ['lineHeight', 'fontSize', 'fontFamily', 'fontWeight'];
var i = cssProperties.length;
while (i--) {
cssHash[ cssProperties[i].toString() ] = elmInputBox.css( cssProperties[i].toString() );
}
elmMentionsOverlay.find('div').css( cssHash );

// Append to wrapper
elmMentionsOverlay.prependTo(elmWrapperBox);
},

_doSearch: function(query) {
Expand Down

0 comments on commit 8a95226

Please sign in to comment.