These are chat archives for GetmeUK/ContentTools

9th
Aug 2016
Jesper Bränn
@Yopi
Aug 09 2016 11:47
Is it possible to register contentedit on something other than a tag name
like, I have multiple things that are divs, and I want to distinguish between them
Jesper Bränn
@Yopi
Aug 09 2016 12:40
ahh, well I guess since custom elements are supported in html5 it's fine to use those instead
Anthony Blackshaw
@anthonyjb
Aug 09 2016 12:59
Hi @Yopi the other option is simply to use http://getcontenttools.com/api/content-edit#tag-names - this way you can call a div anything you want and register an Element of any type to handle it.
Jesper Bränn
@Yopi
Aug 09 2016 13:04
Hey @anthonyjb! So I'd use a pseudo-element in the ce-tag then?
Since custom elements seem to be a real thing these days I think it's probably fine to use them
Jesper Bränn
@Yopi
Aug 09 2016 13:10
Seems like a very good library in general by the way!
Currently trying to migrate away from CKEditor to it, seems like it'll work, haha :-)
Jesper Bränn
@Yopi
Aug 09 2016 13:26
By the way, I was reading through the issues. The fixtures, are they fully working as intended? Or is there a reason why GetmeUK/ContentTools#79 is still open?
Anthony Blackshaw
@anthonyjb
Aug 09 2016 13:30
@Yopi so simple fixtures should work fine, that is you can use a fixture to support a text element such as an article title. There is an example of this in the sandbox/ folder in the repo. We currently use fixtures on a number of recent projects. However fixtures wont yet work on more complex elements such as images, lists, tables, etc which is why the issue is still open - whether this will be supported is not yet decided basically.
@Yopi thanks for the kind comments btw - I'm glad you're using the library :)
Jesper Bränn
@Yopi
Aug 09 2016 13:34
Aha! I see
Jesper Bränn
@Yopi
Aug 09 2016 15:10
@anthonyjb Hmm, another question if you don't mind. Am I misunderstanding something or does an element need to inherit from ResizableElement to be draggable? It seems like even I don't allow it to be resized it cannot be moved if it inherits directly from Element even though the code looks like it should allow it
Anthony Blackshaw
@anthonyjb
Aug 09 2016 16:18
@Yopi no you don't need to inherit from ResizableElement to make an element draggable, you do need to define droppers though, for example: https://github.com/GetmeUK/ContentEdit/blob/master/src/scripts/images.coffee#L107
Droppers determine how to handle an element being dropped on another element and a set of common handlers are provided against the Element class (namely ContentEdit.Element._dropVert and ContentEdit.Element._dropBoth)
Jesper Bränn
@Yopi
Aug 09 2016 17:29
Hmm, strange. I have the droppers but they won't work with just the Element, and if that's the only thing I change then it works
Anthony Blackshaw
@anthonyjb
Aug 09 2016 17:29
can you send me a gist for your code
Anthony Blackshaw
@anthonyjb
Aug 09 2016 17:31
thanks will take a look when I get home this evening and see if I can spot what's going on :)
Jesper Bränn
@Yopi
Aug 09 2016 17:31
Cool! Thanks!
Jesper Bränn
@Yopi
Aug 09 2016 17:49