View Full Version : AddToHome Customizable Plugin!

8 Oct 2011, 2:01 AM
Hi guys!
I just released my AddToHome plugin on my blog and GitHub.

This plugin creates a floating panel with "add to home" behavior. The panel position itself near the links icon in both iPhone and iPad.

There are several customizable built in options such html, dimensions, modal behavior, toolbar and "Ok" button and you can use it as base step to build your own!

Please posts your comments and suggestions in my blog page!

10 Oct 2011, 6:13 AM
Why do you do this?

constructor: function(config) {

Instead of a Panel, why not use Sheet? It handles the sizing even when orientation changes.

11 Oct 2011, 4:07 AM
Hi mitchellsimoens,
first thing: i'm new to sencha... i'm studing it since a few days so all my code may need optimization. Every comments and suggestion are welcome!


This line apply plugin's instance configuration to the object configuration itself. It is usefull to setup custom messages, ui controls etc.


This line call the parent class constructor to maintain initialization hierarchy. I'm on right?
After your comment i tested my component commenting and decommenting this line but things does not changes...

Can you teach me how to optimize this code?

Thank you!

11 Oct 2011, 4:35 AM
If you don't do anything in a method then you don't need to override it. Apply the config stuff to this isn't really needed as after the constructor it will be on 'this'. You say things don't change with or without the constructor method in your plugin so that tells you that you don't need it.

11 Oct 2011, 5:22 AM
I need to override the "construct" method because of this line.


If i comment this line the plugin will not inherit its configuration.

How to make my code better?
(I will study sheet component next days!)