New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

adaptable-text

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adaptable-text - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

2

package.json
{
"name": "adaptable-text",
"title": "Adaptable Text",
"version": "0.1.0",
"version": "0.1.1",
"description": "Adapt font size to fit text in element (WIP)",

@@ -6,0 +6,0 @@ "keywords": [

@@ -45,6 +45,10 @@ // Generated by CoffeeScript 1.9.2

var textWidth;
this.text = this.element.value;
this.text = this.element.value || this.element.textContent;
textWidth = this._getTextWidth(this.text, this.styles.fontStyle + " " + this.currentFontSize + "px " + this.styles.fontFamily);
this.previousFontSize = this.currentFontSize;
this._checkSize();
this.element.style.fontSize = this.currentFontSize + "px";
if (this.previousFontSize !== this.currentFontSize) {
this.currentFontSize = ~~(this.currentFontSize * 100) / 100;
this.element.style.fontSize = this.currentFontSize + "px";
}
};

@@ -103,5 +107,5 @@

AdaptableText.prototype._calculateMaxCharWidth = function(text, font) {
AdaptableText.prototype._calculateMaxCharWidth = function() {
var char, charWidth, chars, len;
chars = 'qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM'.split('');
chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefhijklmnopqrstuvwxyz0123456789!?*()@£$%^&_-+=[]{}:;\'"\\|<>,./~`'.split('');
len = chars.length;

@@ -108,0 +112,0 @@ while (len--) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc