mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-04-28 18:15:47 +02:00
Add checkbox support to edit-design plugin and delay theme change
This commit is contained in:
parent
a315ed90af
commit
9fed8c022b
Resources/Plugins/edit-design
@ -111,15 +111,30 @@ enabled(){
|
||||
|
||||
modal.find("[data-td-key]").each(function(){
|
||||
let item = $(this);
|
||||
let tag = item.prop("tagName");
|
||||
let key = item.attr("data-td-key");
|
||||
|
||||
if (item.prop("tagName") === "SELECT"){
|
||||
// INPUTS
|
||||
if (tag === "INPUT"){
|
||||
let type = item.attr("type");
|
||||
|
||||
if (type === "checkbox"){
|
||||
item.prop("checked", me.config[key]);
|
||||
|
||||
item.change(function(){
|
||||
updateKey(key, item.prop("checked"));
|
||||
});
|
||||
}
|
||||
}
|
||||
// SELECTS
|
||||
else if (tag === "SELECT"){
|
||||
item.val(me.config[key]);
|
||||
|
||||
item.change(function(){
|
||||
updateKey(key, item.val());
|
||||
});
|
||||
}
|
||||
// CUSTOM ELEMENTS
|
||||
else{
|
||||
let value = item.attr("data-td-value");
|
||||
|
||||
@ -138,8 +153,10 @@ enabled(){
|
||||
modal.find("[data-td-theme='"+TD.settings.getTheme()+"']").prop("checked", true);
|
||||
|
||||
modal.find("[data-td-theme]").change(function(){
|
||||
TD.settings.setTheme($(this).attr("data-td-theme"));
|
||||
$(document).trigger("uiToggleTheme");
|
||||
setTimeout(function(){
|
||||
TD.settings.setTheme($(this).attr("data-td-theme"));
|
||||
$(document).trigger("uiToggleTheme");
|
||||
}, 1);
|
||||
});
|
||||
}).methods({
|
||||
_render: () => $(this.htmlModal),
|
||||
|
@ -142,6 +142,11 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.td-modal-content label.checkbox {
|
||||
margin: 6px 16px 5px 4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* Avatar shape */
|
||||
|
||||
.td-avatar-shape-container {
|
||||
|
Loading…
Reference in New Issue
Block a user