Skip to content

Commit

Permalink
Merge pull request #161 from sandydoo/breaking-remove-support-for-cla…
Browse files Browse the repository at this point in the history
…ss-names
  • Loading branch information
sandydoo authored Nov 21, 2021
2 parents 9de5406 + b19265a commit 5960e37
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 18 deletions.
3 changes: 1 addition & 2 deletions addon/components/g-map.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{{#let (component 'g-map/canvas' onCanvasReady=this.getCanvas) as |Canvas|}}
{{#unless (has-block-params)}}
{{!-- Compatibility: @classNames should be deprecated --}}
<Canvas class={{@classNames}} ...attributes />
<Canvas ...attributes />
{{/unless}}

{{yield (hash
Expand Down
3 changes: 1 addition & 2 deletions addon/components/g-map/control.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{{#if this.container}}
{{#in-element this.container}}
{{!-- Compatibility: @classNames should be deprecated --}}
<div id={{this.id}} class={{@classNames}} ...attributes {{g-map/did-insert this.getControl}}>{{yield}}</div>
<div id={{this.id}} ...attributes {{g-map/did-insert this.getControl}}>{{yield}}</div>
{{/in-element}}
{{/if}}
2 changes: 1 addition & 1 deletion addon/utils/options-and-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { next } from '@ember/runloop';

import { HAS_NATIVE_PROXY } from './platform';

export const ignoredOptions = ['lat', 'lng', 'getContext', 'classNames'];
export const ignoredOptions = ['lat', 'lng', 'getContext'];

const IGNORED = Symbol('Ignored'),
EVENT = Symbol('Event'),
Expand Down
2 changes: 0 additions & 2 deletions lib/ast-transforms/canvas-enforcer.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ function enforceCanvas(env) {
return;
}

// No need to parse classNames; we pass them via the component.

let canvas = b.mustache(b.path(`${blockParam}.canvas`));

children.unshift(canvas);
Expand Down
11 changes: 0 additions & 11 deletions tests/integration/components/g-map/canvas-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,6 @@ module('Integration | Component | g map/canvas', function (hooks) {
);
});

test('compatibility: it passes class names via `@classNames` to the default canvas', async function (assert) {
await render(hbs`
<GMap @lat={{this.lat}} @lng={{this.lng}} @classNames="extra-class-names" />
`);

assert.ok(
find('.extra-class-names'),
'canvas rendered with extra class names'
);
});

test('it renders a custom canvas div', async function (assert) {
await render(hbs`
<GMap @lat={{this.lat}} @lng={{this.lng}} as |g|>
Expand Down

0 comments on commit 5960e37

Please sign in to comment.