mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 735987 - [New Tab Page] Dropping blocked links onto the grid again should unblock them; r=dietrich
This commit is contained in:
parent
596c9d1a03
commit
6dc6c177cc
@ -94,7 +94,11 @@ let gDrop = {
|
||||
// A new link was dragged onto the grid. Create it by pinning its URL.
|
||||
let dt = aEvent.dataTransfer;
|
||||
let [url, title] = dt.getData("text/x-moz-url").split(/[\r\n]+/);
|
||||
gPinnedLinks.pin({url: url, title: title}, index);
|
||||
let link = {url: url, title: title};
|
||||
gPinnedLinks.pin(link, index);
|
||||
|
||||
// Make sure the newly added link is not blocked.
|
||||
gBlockedLinks.unblock(link);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -25,6 +25,7 @@ _BROWSER_FILES = \
|
||||
browser_newtab_bug723121.js \
|
||||
browser_newtab_bug725996.js \
|
||||
browser_newtab_bug734043.js \
|
||||
browser_newtab_bug735987.js \
|
||||
head.js \
|
||||
$(NULL)
|
||||
|
||||
|
22
browser/base/content/test/newtab/browser_newtab_bug735987.js
Normal file
22
browser/base/content/test/newtab/browser_newtab_bug735987.js
Normal file
@ -0,0 +1,22 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function runTests() {
|
||||
setLinks("0,1,2,3,4,5,6,7,8");
|
||||
setPinnedLinks("");
|
||||
|
||||
yield addNewTabPageTab();
|
||||
checkGrid("0,1,2,3,4,5,6,7,8");
|
||||
|
||||
yield simulateDrop(cells[1]);
|
||||
checkGrid("0,99p,1,2,3,4,5,6,7");
|
||||
|
||||
yield blockCell(cells[1]);
|
||||
checkGrid("0,1,2,3,4,5,6,7,8");
|
||||
|
||||
yield simulateDrop(cells[1]);
|
||||
checkGrid("0,99p,1,2,3,4,5,6,7");
|
||||
|
||||
yield blockCell(cells[1]);
|
||||
checkGrid("0,1,2,3,4,5,6,7,8");
|
||||
}
|
@ -383,6 +383,15 @@ let BlockedLinks = {
|
||||
Storage.set("blockedLinks", this.links);
|
||||
},
|
||||
|
||||
/**
|
||||
* Unblocks a given link.
|
||||
* @param aLink The link to unblock.
|
||||
*/
|
||||
unblock: function BlockedLinks_unblock(aLink) {
|
||||
if (this.isBlocked(aLink))
|
||||
delete this.links[aLink.url];
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns whether a given link is blocked.
|
||||
* @param aLink The link to check.
|
||||
|
Loading…
Reference in New Issue
Block a user