Skip to content

Commit

Permalink
Merge pull request #183 from Ruslan-Aleev/files-tooltip
Browse files Browse the repository at this point in the history
Added a tooltip for fields with the type "file" and "image"
  • Loading branch information
muzzwood authored Sep 16, 2022
2 parents 1eceff9 + f00a4b9 commit 4b77ea4
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion assets/components/clientconfig/js/mgr/sections/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ Ext.extend(ClientConfig.page.Home,MODx.Component,{
field.growMin = 150;
field.growMax = 800;
}

if (field.xtype === 'code') {
field.height = 150;
field.xtype = Ext.ComponentMgr.isRegistered('modx-texteditor') ? 'modx-texteditor' : 'textarea';
Expand Down Expand Up @@ -141,6 +142,20 @@ Ext.extend(ClientConfig.page.Home,MODx.Component,{
field.tv = value.key;
field.source = value.source || MODx.config.default_media_source;
field.relativeValue = (value.value != '') ? value.value : value.default;
if (ClientConfig.isAdmin) {
field.listeners = {
render: function(fld) {
new Ext.ToolTip({
target: fld.label.dom,
html: field.description
});
new Ext.ToolTip({
target: fld.getEl(),
html: field.description
});
}
}
}
}

if (field.xtype === 'colorpickerfield') {
Expand All @@ -151,6 +166,7 @@ Ext.extend(ClientConfig.page.Home,MODx.Component,{
field.xtype = 'textfield';
field.inputType = 'password';
}

if (field.xtype === 'email') {
field.xtype = 'textfield';
field.vtype = 'email';
Expand Down Expand Up @@ -335,7 +351,7 @@ Ext.extend(ClientConfig.page.Home,MODx.Component,{
if (fp && fp.getForm()) {
var values = fp.getForm().getValues();

// Fix name of image tv
// Fix name of image & file tv
var imagePickers = fp.find('xtype', 'modx-panel-tv-image');
Ext.each(imagePickers, function(imagePicker){
values[imagePicker.name] = values['tv' + imagePicker.name];
Expand Down

0 comments on commit 4b77ea4

Please sign in to comment.