mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-05-05 11:34:07 +02:00
Fix and refactor 'Stay open' pin, that was broken after composer update
This commit is contained in:
parent
1056273c57
commit
85559b6083
Resources/Scripts
@ -1321,29 +1321,25 @@
|
||||
//
|
||||
// Block: Add a pin icon to make tweet compose drawer stay open.
|
||||
//
|
||||
onAppReady.push(function setupStayOpenPin(){
|
||||
let ele = $(`
|
||||
<svg id="td-compose-drawer-pin" viewBox="0 0 24 24" class="icon js-show-tip" data-original-title="Stay open" data-tooltip-position="left">
|
||||
<path d="M9.884,16.959l3.272,0.001l-0.82,4.568l-1.635,0l-0.817,-4.569Z"/>
|
||||
<rect x="8.694" y="7.208" width="5.652" height="7.445"/>
|
||||
<path d="M16.877,17.448c0,-1.908 -1.549,-3.456 -3.456,-3.456l-3.802,0c-1.907,0 -3.456,1.548 -3.456,3.456l10.714,0Z"/>
|
||||
<path d="M6.572,5.676l2.182,2.183l5.532,0l2.182,-2.183l0,-1.455l-9.896,0l0,1.455Z"/>
|
||||
</svg>`).appendTo(".js-docked-compose .js-compose-header");
|
||||
|
||||
ele.click(function(){
|
||||
execSafe(function setupStayOpenPin(){
|
||||
$(document).on("tduckOldComposerActive", function(e){
|
||||
let ele = $(`#import "markup/pin.html"`).appendTo(".js-docked-compose .js-compose-header");
|
||||
|
||||
ele.click(function(){
|
||||
if (TD.settings.getComposeStayOpen()){
|
||||
ele.css("transform", "rotate(0deg)");
|
||||
TD.settings.setComposeStayOpen(false);
|
||||
}
|
||||
else{
|
||||
ele.css("transform", "rotate(90deg)");
|
||||
TD.settings.setComposeStayOpen(true);
|
||||
}
|
||||
});
|
||||
|
||||
if (TD.settings.getComposeStayOpen()){
|
||||
ele.css("transform", "rotate(0deg)");
|
||||
TD.settings.setComposeStayOpen(false);
|
||||
}
|
||||
else{
|
||||
ele.css("transform", "rotate(90deg)");
|
||||
TD.settings.setComposeStayOpen(true);
|
||||
}
|
||||
});
|
||||
|
||||
if (TD.settings.getComposeStayOpen()){
|
||||
ele.css("transform", "rotate(90deg)");
|
||||
}
|
||||
});
|
||||
|
||||
//
|
||||
|
6
Resources/Scripts/imports/markup/pin.html
Normal file
6
Resources/Scripts/imports/markup/pin.html
Normal file
@ -0,0 +1,6 @@
|
||||
<svg id="td-compose-drawer-pin" viewBox="0 0 24 24" class="icon js-show-tip" data-original-title="Stay open" data-tooltip-position="left">
|
||||
<path d="M9.884,16.959l3.272,0.001l-0.82,4.568l-1.635,0l-0.817,-4.569Z"/>
|
||||
<rect x="8.694" y="7.208" width="5.652" height="7.445"/>
|
||||
<path d="M16.877,17.448c0,-1.908 -1.549,-3.456 -3.456,-3.456l-3.802,0c-1.907,0 -3.456,1.548 -3.456,3.456l10.714,0Z"/>
|
||||
<path d="M6.572,5.676l2.182,2.183l5.532,0l2.182,-2.183l0,-1.455l-9.896,0l0,1.455Z"/>
|
||||
</svg>
|
After (image error) Size: 488 B |
@ -249,10 +249,14 @@ a[data-full-url] {
|
||||
transition: transform 0.1s ease;
|
||||
}
|
||||
|
||||
.js-docked-compose footer {
|
||||
.js-docked-compose .compose-remember-state {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.js-new-composer-opt-in {
|
||||
border-bottom: none !important;
|
||||
}
|
||||
|
||||
.compose-content {
|
||||
bottom: 0 !important;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user