10
Jun 13

The ‘Disabled’ attribute in Internet Explorer

Given the market share that IE enjoys it is a victory for you to make your website work in IE same as chrome and other modern browsers. Development for IE is difficult and the developer tools provided by IE makes this experience awful .

Lets get to the point of this article which is to explain how the ‘disabled’ attribute works in IE . Given  below is the specification of the ‘disabled’ attribute from W3C specification.

disabled [CI]
When set for a form control, this boolean attribute disables the control for user input.
When set, the disabled attribute has the following effects on an element:

Disabled controls do not receive focus.
Disabled controls are skipped in tabbing navigation.
Disabled controls cannot be successful.
The following elements support the disabled attribute: BUTTON INPUT, OPTGROUP, OPTION, SELECT, and TEXTAREA.

This attribute is inherited but local declarations override the inherited value.

How disabled elements are rendered depends on the user agent. For example, some user agents “gray out” disabled menu
items, button labels, etc.

 

This clearly mentions that ‘disabled’ attribute only works on BUTTON INPUT, OPTGROUP, OPTION, SELECT, and TEXTAREA tags and the general policy of browser is if you use any attribute which are not authorized to use in tag then browsers neglect them but they can be accessed using javascript. But IE isn’t that kind in this case . If you apply ‘disabled’ on div tag, IE takes it seriously and makes div tag disabled . So what this means is that we not only  have any control event on div  but also according to “This attribute is inherited but local declarations override the inherited value.” rule in W3C disable specification, IE applies disabled attribute on nested elements in div tag. So be careful.

 


13
Jan 12

Reset your last commit in git

So, you committed a change in your local repo and then realized you had the wrong branch? This happens to me a lot and the command I found the most useful for this purpose is:

git reset --soft HEAD^

git reset

Run the above 2 commands and you will have your uncommitted files back. After that you can switch to the right branch and commit them again.

 


29
Dec 11

Git branching model followed by us

We use the below branching model for our products JustUnfollow and GrabInbox . This is the article that made me use this branching model.

We have 2 parallel branches – ‘master’ and ‘develop’. All development occurs on the ‘develop’ branch. You can create new branches from the ‘develop’ branch and then merge them back to ‘develop’ once a feature is ready.

When it’s time to deploy a feature, we create a new ‘release-x.x’ (x.x = version) branch from the ‘develop’ branch. We can test this release branch, fix bugs and other small changes to make it ready for release. Once we are certain this branch is ready for release, we merge it with ‘develop’ and also ‘master’. We then tag this commit in master and deploy the ‘master’ to production.

Example git commands:

git checkout develop
git checkout -b release-0.1 develop
git checkout develop
git merge –no-ff release-0.1 develop
git checkout master
git merge –no-ff release-0.1 master
git tag “0.1″
git branch -d release-0.1

Now, if there are bug fixes that need to go into production quickly, we create a new ‘hotfix-x.x’ branch from ‘master’. After fixing the bug, we merge ‘hotfix-x.x’ to ‘master’ and also ‘develop’. We then tag this release in ‘master’ and deploy the ‘master’ to production.

Example git commands:

git checkout master
git checkout -b hotfix-0.1.1 master
git checkout develop
git merge –no-ff hotfix-0.1.1 develop
git checkout master
git merge –no-ff hotfix-0.1.1 master
git tag “0.1.1″
git branch -d hotfix-0.1.1