Skip to content

Commit

Permalink
chore(site): small slides corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
ala-n committed Jun 27, 2024
1 parent 00b66a7 commit bb1d6f6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 21 deletions.
5 changes: 0 additions & 5 deletions site/views/overview/quick/02-core/04-event-listener.njk
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ parent: 00-core

{% code 'typescript', 'code-block' %}
class MyComponent extends ESLBaseElement {
@listen('click')
onClick(event) {
console.log('Component clicked', event);
}

@listen({event: 'click', selector: 'button'})
onBtnClick(event) {
console.log('Button click catched with delegation', event);
Expand Down
14 changes: 4 additions & 10 deletions site/views/overview/quick/02-core/05-media-query.njk
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,10 @@ parent: 00-core
<h3>{{ title }}</h3>

{% code 'typescript', 'code-block' %}
import {ESLMediaQuery} from '@exadel/esl';

ESLMediaQuery.for('@XS').addListener((event) => {
console.log('Media query changed', event.matches);
})
ESLMediaQuery.for('@XS').matches; // true if XS
{% endcode %}

class Test {
{% code 'typescript', 'code-block' %}
@listen({event: 'change', target: ESLMediaQuery.for('@XS or @SM')})
onMediaQueryChange(event) {
console.log('Media query changed', event.matches);
}
}
onMediaQueryChange(event) {/*...*/}
{% endcode %}
10 changes: 4 additions & 6 deletions site/views/overview/quick/02-core/06-traversing-query.njk
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ parent: 00-core
<h3>{{ title }}</h3>

{% code 'typescript', 'code-block' %}
import {ESLTraversingQuery} from '@exadel/esl';

const $base = ...; // some base element (as context)

const $result = ESLTraversingQuery.find($base, '::find(button)::visible'); // find all visible buttons in the base element
const $result = ESLTraversingQuery.find($base, '::find(button)::nth(2)'); // find second button in the base element
const $result = ESLTraversingQuery.find($base, '::next'); // get next sibling of the base element
const $result = ESLTraversingQuery.find($base, '::prev(a)'); // get previous sibling of the base element that is an anchor
ESLTraversingQuery.find($base, '::find(button)::visible'); // find all visible buttons in the base element
ESLTraversingQuery.find($base, '::find(button)::nth(2)'); // find second button in the base element
ESLTraversingQuery.find($base, '::next'); // get next sibling of the base element
ESLTraversingQuery.find($base, '::prev(a)'); // get previous sibling of the base element that is an anchor
{% endcode %}

0 comments on commit bb1d6f6

Please sign in to comment.