Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add globalOverwrites? #2

Closed
Systerr opened this issue Aug 18, 2015 · 3 comments
Closed

Add globalOverwrites? #2

Systerr opened this issue Aug 18, 2015 · 3 comments

Comments

@Systerr
Copy link
Contributor

Systerr commented Aug 18, 2015

This feature needed if we want to overwrite some default values. For example we want to grab additional attributesToGrab.
Maybe like this.

spiralFrontend.globalOverwrites = {
    instances: {//type
        Form:{
            attributesToGrab:{
                "action2": {
                    "key": "url",
                    "value": "/"
                }
            }
        }

    }
}

Or maybe for change default classes

@Systerr
Copy link
Contributor Author

Systerr commented Aug 18, 2015

I think that for usage like described we should use inheritance.
If any one have suggestion please write it.

@alexichepura
Copy link
Contributor

we came up to the idea of placing variable before sf.js runs.

var sf = {
  defaultOptions: {
    instances: {
      form: {
        messagesType: "spiral"
      }
    }
  }
}

So the sequence to gather options:
0) defaultOptions from instance itself (if need and provided by the instance itself)

  1. sf.defaultOptions
  2. data-options - should accept JSON string or variable name
  3. optionsToGrab

@alexichepura
Copy link
Contributor

Implemented.
data-options is in #4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants