[epiphany/mcatanzaro/thumbnail-background-position] Rewrite Ephy.Overview.Item.thumbnailPath()
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/mcatanzaro/thumbnail-background-position] Rewrite Ephy.Overview.Item.thumbnailPath()
- Date: Tue, 6 Aug 2019 18:02:43 +0000 (UTC)
commit 3b40c9abc5ad3b805dcedd444dfda0cb4eadf135
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Tue Aug 6 13:02:27 2019 -0500
Rewrite Ephy.Overview.Item.thumbnailPath()
The original implementation works, but it seems fragile and I have no
idea why this approach was chosen. This simpler implementation seems to
work.
embed/web-process-extension/resources/js/overview.js | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
---
diff --git a/embed/web-process-extension/resources/js/overview.js
b/embed/web-process-extension/resources/js/overview.js
index df65a6272..46f1bcd32 100644
--- a/embed/web-process-extension/resources/js/overview.js
+++ b/embed/web-process-extension/resources/js/overview.js
@@ -221,18 +221,11 @@ Ephy.Overview.Item = class OverviewItem
thumbnailPath()
{
- let style = this._thumbnail.style;
- if (style.isPropertyImplicit('background'))
+ let backgroundImage = this._thumbnail.style.backgroundImage;
+ if (!backgroundImage || !background.startsWith('url("file://'))
return null;
- let background = style.getPropertyValue('background');
- if (!background)
- return null;
-
- if (background.startsWith('url("file://'))
- return background.replace('url("file://', '').replace('"); background-size: 100%', '');
-
- return null;
+ return background.replace('url("file://', '');
}
setThumbnailPath(path)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]