You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When upload image on mobile phone, the editor always put screen width as dimensions width automatically.
We wish it looks bigger on computer, so anyway to disable auto dimensions.
There is an option: https://www.tiny.cloud/docs/plugins/opensource/image/#image_dimensions
To disable image_dimensions, the dimensions input box will disappear as well, but we want to keep it.
Here's a solution to disable auto dimensions (Provided by https://assbbs.com)
setup:function(editor){
editor.on(\'OpenWindow\',function(e){
var lock=document.querySelector(\'.tox-lock\');
if(lock){
var height_input=lock.parentNode.previousElementSibling.querySelector(\'input\');
var width_input=lock.parentNode.previousElementSibling.previousElementSibling.querySelector(\'input\');
var getter=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,\'value\').get;
var setter=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,\'value\').set;
var srcurl=lock.parentNode.parentNode.parentNode.parentNode.querySelector(\'input[type="url"]\');
var raito=0;if(width_input.value && height_input.value){raito=width_input.value/height_input.value;}
Object.defineProperty(width_input,\'value\',{set(val){},get(){return getter.call(this);}});
Object.defineProperty(height_input,\'value\',{set(val){},get(){return getter.call(this);}});
srcurl.addEventListener(\'input\',function(){setter.call(width_input,\'\');setter.call(height_input,\'\');raito=0;});
width_input.addEventListener(\'input\',function(){if(raito && document.querySelector(\'.tox-locked\')){setter.call(height_input,(getter.call(width_input)/raito).toFixed());};});
height_input.addEventListener(\'input\',function(){if(raito && document.querySelector(\'.tox-locked\')){setter.call(width_input,(getter.call(height_input)*raito).toFixed());};});
};
});
}
However it seems too complex and uses extra code hack.
Is it possible to provide an official option about this?
Thanks a lot!
Best
The text was updated successfully, but these errors were encountered:
Hi @unknown202101! Thanks for your feedback. Yes, there are room for improvements and I have flagged your feedback as a feature request, but unfortunately I can't provide any additional if or when we get to address this. We'll keep you updated here.
This issue is stale because it has been open 365 days with no activity. Please comment if you wish to keep this issue open or it will be closed in 30 days.
When upload image on mobile phone, the editor always put screen width as dimensions width automatically.
We wish it looks bigger on computer, so anyway to disable auto dimensions.
There is an option: https://www.tiny.cloud/docs/plugins/opensource/image/#image_dimensions
To disable image_dimensions, the dimensions input box will disappear as well, but we want to keep it.
Here's a solution to disable auto dimensions (Provided by https://assbbs.com)
However it seems too complex and uses extra code hack.
Is it possible to provide an official option about this?
Thanks a lot!
Best
The text was updated successfully, but these errors were encountered: