Skip to content

Commit ae46bac

Browse files
author
Amit Shuster
committed
Merged PR 12807: Playground Edge adjustments
Playground Edge adjustments 1. Share report bookmark URL on Edge was cut, moved to use localStorage instead of sharing the bookmark state 2. Custom layout on small screens on Edge didn't calculate well (too accurate after the period)
1 parent 43f5f05 commit ae46bac

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

demo/v2-demo/live_showcases/bookmarks/showcase_bookmarks.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,12 @@ function embedSharedBookmark(enableFilterPane, bookmarkState) {
8888
// We give the user View permissions
8989
var permissions = models.Permissions.View;
9090

91-
// Get the bookmark state from url param
92-
var bookmarkState = GetBookmarkStateFromURL();
91+
// Get the bookmark name from url param
92+
var bookmarkName = GetBookmarkNameFromURL();
93+
94+
// Get the bookmark state from local storage
95+
// any type of database can be used
96+
var bookmarkState = localStorage.getItem(bookmarkName);
9397

9498
// Embed configuration used to describe the what and how to embed
9599
// This object is used when calling powerbi.embed
@@ -227,7 +231,11 @@ function shareBookmark(element) {
227231
let currentBookmark = getBookmarkByID(bookmarkId);
228232

229233
// Build the share bookmark URL
230-
let shareUrl = location.href.substring(0, location.href.lastIndexOf("/")) + '/shareBookmark.html' + '?state=' + currentBookmark.state;
234+
let shareUrl = location.href.substring(0, location.href.lastIndexOf("/")) + '/shareBookmark.html' + '?name=' + currentBookmark.name;
235+
236+
// Store bookmark state with name as a key on the local storage
237+
// any type of database can be used
238+
localStorage.setItem(currentBookmark.name, currentBookmark.state);
231239

232240
// Set bookmark display name and share URL on dialog HTML code
233241
$('#dialogBookmarkName').empty();
@@ -284,10 +292,10 @@ function buildShareElement() {
284292
return imgElement;
285293
}
286294

287-
// Get the bookmark state from url 'state' argument
288-
function GetBookmarkStateFromURL() {
295+
// Get the bookmark name from url 'name' argument
296+
function GetBookmarkNameFromURL() {
289297
url = window.location.href;
290-
let regex = new RegExp("[?&]state(=([^&#]*)|&|#|$)"),
298+
let regex = new RegExp("[?&]name(=([^&#]*)|&|#|$)"),
291299
results = regex.exec(url);
292300
if (!results) return null;
293301
if (!results[2]) return '';

demo/v2-demo/live_showcases/custom_layout/showcase_custom_layout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ function renderVisuals() {
181181

182182
// Calculating (x,y) position for the next visual
183183
x += width + LayoutShowcaseConsts.margin;
184-
if (x >= pageWidth) {
184+
if (x + width > pageWidth) {
185185
x = LayoutShowcaseConsts.margin;
186186
y += height + LayoutShowcaseConsts.margin;
187187
}

0 commit comments

Comments
 (0)