Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hansek/4721517 to your computer and use it in GitHub Desktop.
Save hansek/4721517 to your computer and use it in GitHub Desktop.
Definition of browser field in my panel.js, but it returns only one argument (data about selected image), but there is no info in which Media Source was file selected.
{
name: 'annex',
fieldLabel: _('workshops.annex'),
xtype: 'modx-combo-browser',
id: this.ident +'-annex',
maxLength: 250,
hideFiles: true,
listeners: {
'select': {
fn: function(data) {
console.log(arguments);
},
scope: this
}
}
}
@hansek
Copy link
Author

hansek commented Feb 6, 2013

Only what I get in console is result:

Object
cls: "icon-access"
dateString: "12/03/2012 9:18 am"
disabled: false
ext: "access"
fullRelativeUrl: "ht.access"
image: "/www/manager/templates/default/images/restyle/nopreview.jpg"
image_height: 60
image_width: 80
lastmod: Mon Dec 03 2012 09:18:10 GMT+0100 (Střední Evropa (běžný čas))
menu: Array[1]
name: "ht.access"
pathname: "D:/www/modx.revolution.test/www/\ht.access"
relativeUrl: "ht.access"
shortName: "ht.access"
size: 3519
sizeString: "3.4 KB"
thumb: "/www/manager/templates/default/images/restyle/nopreview.jpg"
thumb_height: 60
thumb_width: 80
url: "ht.access"
__proto__: Object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment