Skip to content

Commit f8b070a

Browse files
committed
feat: queryDocumentSelectorAll - ability to query iframes and parent of iframes
1 parent 2485b0f commit f8b070a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Diff for: src/index.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/*globals CustomEvent, CoCreate*/
88
import observer from '@cocreate/observer';
99
import action from '@cocreate/actions';
10-
import {queryFrameSelectorAll} from '@cocreate/utils';
10+
import {queryDocumentSelectorAll} from '@cocreate/utils';
1111

1212
function init() {
1313
let elements = document.querySelectorAll(`[show],[hide]`);
@@ -47,10 +47,10 @@ function selectShowHideEle(e) {
4747
if (value != '') {
4848
var show = opt.getAttribute('show');
4949
if (typeof show != 'undefined') {
50-
for (let el of queryFrameSelectorAll(show))
50+
for (let el of queryDocumentSelectorAll(show))
5151
el.setAttribute('hidden', '');
5252
if (opt.selected === true) {
53-
for (let el of queryFrameSelectorAll(show))
53+
for (let el of queryDocumentSelectorAll(show))
5454
el.removeAttribute('hidden');
5555
}
5656
}
@@ -73,12 +73,12 @@ function clickShowHideEle(e) {
7373

7474
show = radio.getAttribute('show');
7575

76-
for (let el of queryFrameSelectorAll(show)) {
76+
for (let el of queryDocumentSelectorAll(show)) {
7777
el.setAttribute('hidden', '');
7878
}
7979

8080
if (radio.checked) {
81-
for (let el of queryFrameSelectorAll(show))
81+
for (let el of queryDocumentSelectorAll(show))
8282
el.removeAttribute('hidden');
8383
}
8484
}
@@ -87,14 +87,14 @@ function clickShowHideEle(e) {
8787

8888
let updated_els = [];
8989

90-
for (let el of queryFrameSelectorAll(show)) {
90+
for (let el of queryDocumentSelectorAll(show)) {
9191
if (el.hasAttribute('hidden')) {
9292
el.removeAttribute('hidden');
9393
updated_els.push(el);
9494
}
9595
}
9696

97-
for (let el of queryFrameSelectorAll(hide)) {
97+
for (let el of queryDocumentSelectorAll(hide)) {
9898
let existEqual = false;
9999
for (let uel of updated_els) {
100100
if (el.isEqualNode(uel)) {

0 commit comments

Comments
 (0)