Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

PropertyEditor widgets namespacing isn't respected #166

Open
wimleers opened this issue Mar 1, 2013 · 2 comments
Open

PropertyEditor widgets namespacing isn't respected #166

wimleers opened this issue Mar 1, 2013 · 2 comments

Comments

@wimleers
Copy link
Contributor

wimleers commented Mar 1, 2013

Create has Create.editWidget as a PropertyEditor widget.

Suppose Drupal wants to create its own widget with the same name: Drupal.editWidget.

Create doesn't support this; it doesn't take the name. However, Create can't support this, because it's a deficiency on jQuery's end: http://stackoverflow.com/questions/7739525/jquery-ui-how-to-call-a-widget-function-with-its-namespace

I think:

  1. this should be documented
  2. this is then no longer really "namespacing", because namespacing in every other language/project I know implies that you can use more generic names, whereas here you should sufficient specificity in the non-namespaced part of the name.
@wimleers
Copy link
Contributor Author

wimleers commented Mar 1, 2013

That being said, the work-around indicated in the aforementioned StackOverflow post ("bridging" it; which is a silly term the jQuery guys invented for the widespread "aliasing") does not work in combination with Create.js. This makes me suspect something is wrong.

jQuery.widget('foobar', jQuery.editWidget)

Then use the "foobar" editor. This should work, but it fails. It crashes in Midgard.midgardEditable._params(), where it tries to access propertyElement: this.options.propertyEditors[predicate].element, which never gets set when using bridges.


Consequently, Drupal is forced to use editor names and thus jQuery functions like jQuery.direct instead of the less generic jQuery.DrupalEditEditor_direct.

@wimleers
Copy link
Contributor Author

wimleers commented Mar 1, 2013

Summary from a Drupal POV: http://drupal.org/node/1874934#comment-7124904.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant