Comments (5)
myConfig.init($("div.content-mid"),
Your problem is that you are using jQuery and the $
function doesn't actually return the DOM element object but some weird object that jQuery uses. You need to replace that code with:myConfig.init($("div.content-mid").get(0),
The I have to change in code every place where I'm using it.Yeah basically. But pretty much every GUI framework would make you do something similar to change the order of elements. You might be able to cheat by using reverse().
from gm_config.
what about assaigning values to those list elements?
what about sth like that?
"type" : "select",
"options" : ["A" : 0, "B" : 1],
"default" : "A"
}
from gm_config.
That isn't valid JS syntax. It would have to be:
{ "type" : "select", "options" : {"A" : 0, "B" : 1}, "default" : "A" }And even that doesn't solve your problem because you still have to change the numerical values to change the order, which isn't any less work than just changing the order. So yeah it's kind of inconvenient but it's a pretty small change to get the desired result. Personally I would wire the code like this myself:
var optionFunctions = [(function(){}), battleDesc.hide]; optionFunctions[myConfig.get("msgFightHiddenMode")]();That way you could easily hook up a whole host of different behaviors based on the option that is selected.
from gm_config.
Can you explain me that syntax?
var optionFunctions = [(function(){}), battleDesc.hide];
optionFunctionsmyConfig.get("msgFightHiddenMode");
BTW.
{
"type" : "select",
"options" : {"A" : 0, "B" : 1},
"default" : "A"
}
In this one I could just drag the whole ""A" : 1" to reorder it.
One more question.
Can you give me all supored properties (like: min, max, options, type ....)?
from gm_config.
Can you explain me that syntax?Which syntax are you referring to? The sample code I suggested or object literals versus arrays?
In this one I could just drag the whole ""A" : 1" to reorder it.Oh I see what you mean now. You would have to make the change in two places to reorder it. Okay, I'll create an issue and add this alternative usage.
Can you give me all supored propertiesThat would take some time. I've become a little unfamiliar with GM_config since I haven't used or developed it much recently. You could bury your head in the code and find what is supported. This function is what controls the actual creation of elements based on their properties. And this function is what derives the value from the element.
from gm_config.
Related Issues (20)
- Mention of TypeScript types (@types/gm_config) HOT 9
- TypeScript Type Definitions HOT 2
- Select Multiple HOT 2
- Dynamically creating fields HOT 4
- radio onChange event HOT 1
- Capstone 4.0 HOT 5
- Display: flex ? HOT 1
- Redefine save and close buttons? HOT 3
- Calling get() before init() completes doesn't work anymore HOT 19
- `Object.create(null)` duplication HOT 2
- Strange issue with Unit Test HOT 2
- Alert Text in Unit Test HOT 9
- Hello, I need help with the UI style HOT 1
- Suggestion - add a property `initialized` (Promise object) HOT 1
- File pick implementation HOT 1
- TypeError: field is undefined HOT 1
- Resize window HOT 1
- Scaling config data
- Field value change event
- Does not appear to work with GM4 HOT 24
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gm_config.