Use template strings

This commit is contained in:
Kevin Sawicki 2016-11-03 10:39:40 -07:00
parent 712b15286c
commit 48bcad87c2
3 changed files with 28 additions and 33 deletions

View file

@ -148,8 +148,8 @@ const WebViewImpl = (function () {
minWidth = Math.min(minWidth, maxWidth)
minHeight = Math.min(minHeight, maxHeight)
if (!this.attributes[webViewConstants.ATTRIBUTE_AUTOSIZE].getValue() || (newWidth >= minWidth && newWidth <= maxWidth && newHeight >= minHeight && newHeight <= maxHeight)) {
node.style.width = newWidth + 'px'
node.style.height = newHeight + 'px'
node.style.width = `${newWidth}px`
node.style.height = `${newHeight}px`
// Only fire the DOM event if the size of the <webview> has actually
// changed.
@ -191,7 +191,7 @@ const WebViewImpl = (function () {
// Adds an 'on<event>' property on the webview, which can be used to set/unset
// an event handler.
WebViewImpl.prototype.setupEventProperty = function (eventName) {
const propertyName = 'on' + eventName.toLowerCase()
const propertyName = `on${eventName.toLowerCase()}`
return Object.defineProperty(this.webviewNode, propertyName, {
get: () => {
return this.on[propertyName]
@ -267,7 +267,7 @@ const registerBrowserPluginElement = function () {
const proto = Object.create(HTMLObjectElement.prototype)
proto.createdCallback = function () {
this.setAttribute('type', 'application/browser-plugin')
this.setAttribute('id', 'browser-plugin-' + getNextId())
this.setAttribute('id', `browser-plugin-${getNextId()}`)
// The <object> node fills in the <webview> container.
this.style.flex = '1 1 auto'