Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move trickle jquery.resize library and model functions into core #1576

Closed
oliverfoster opened this issue May 26, 2017 · 2 comments
Closed

Move trickle jquery.resize library and model functions into core #1576

oliverfoster opened this issue May 26, 2017 · 2 comments
Milestone

Comments

@oliverfoster
Copy link
Member

oliverfoster commented May 26, 2017

model functions:

getAllDescendantModels(parentFirst);
       /*
        * Fetchs the sub structure of an id as a flattened array
        *
        *   Such that the tree:
        *       { a1: { b1: [ c1, c2 ], b2: [ c3, c4 ] }, a2: { b3: [ c5, c6 ] } }
        *
        *   will become the array (parent first = false):
        *       [ c1, c2, b1, c3, c4, b2, a1, c5, c6, b3, a2 ]
        *
        *   or (parent first = true):
        *       [ a1, b1, c1, c2, b2, c3, c4, a2, b3, c5, c6 ]
        *
        * This is useful when sequential operations are performed on the page/article/block/component hierarchy.
        */
findRelativeModel(searchString, options);
       /*
        * Returns a relative structural item from the Adapt hierarchy
        *   
        *   Such that in the tree:
        *       { a1: { b1: [ c1, c2 ], b2: [ c3, c4 ] }, a2: { b3: [ c5, c6 ] } }
        *
        *       modelC1.findRelative("@block +1") = modelB2;
        *       modelC1.findRelative("@component +4") = modelC5;
        *
        *  options.limitParentId = limit to descendants only (should be renamed)
        *  options.filter = function(item, index) {  return true }
       *   options.loop = should wrap around
        */

jquery.resize library:
$('selector').on("resize", callback); is able to watch for changes in all document elements, not just the window

@moloko
Copy link
Contributor

moloko commented May 26, 2017

so long as you change getDescendents to getDescendants, I'm happy ;-)

@oliverfoster
Copy link
Member Author

oliverfoster commented May 26, 2017

I think it is. I just keep misspelling it. descendent != ascendant, descendant != ancestor.. come on brain.

https://github.com/adaptlearning/adapt-contrib-trickle/blob/master/js/lib/adaptModelExtension.js#L22

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

No branches or pull requests

3 participants