Bug 933192 - [Settings] can join hidden wifi network without ssid name r=ejchen

Bug 933192 - [Settings] can join hidden wifi network without ssid name r=ejchen
now that we're using this multiple times, it's better to put it in an external function and call it from the listeners