File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 8080 */
8181 function parseAction ( element ) {
8282 var action = { } ;
83- var match = element . className . match ( / a l o h a - a c t i o n - ( \w + ) ( - ( \w + ) ) ? / ) ;
83+ var match ;
84+
85+ Dom . childAndParentsUntil ( element , function ( element ) {
86+ if ( element . className ) {
87+ match = element . className . match ( / a l o h a - a c t i o n - ( \w + ) ( - ( \w + ) ) ? / ) ;
88+ }
89+ if ( match || Dom . hasClass ( element , 'aloha-toolbar' ) ) {
90+ return true ;
91+ } else {
92+ return false ;
93+ }
94+ } ) ;
8495
8596 if ( match ) {
97+ console . log ( match [ 1 ] , match [ 3 ] ) ;
8698 action [ match [ 1 ] ] = match [ 3 ] || true ;
8799 }
88100
Original file line number Diff line number Diff line change @@ -390,7 +390,8 @@ define([
390390 /**
391391 * Starting with the given node, traverses up the given node's ancestors,
392392 * collecting each parent node, until the first ancestor that causes the
393- * given predicate function to return true.
393+ * given predicate function to return true. The given node is *not* passed
394+ * to the predicate (@see childAndParents).
394395 *
395396 * @param {Node } node
396397 * @param {function(Node):boolean } pred
You can’t perform that action at this time.
0 commit comments