   cleanName:(name)->
     name
 
-  getConfigValue:(fullPath)->
-    atom.config.get @packageName+'.'+fullPath
-
-
-  parseStringChild:(name,obj)->
+  getConfigValue:(name,obj)->
+    fullPath = @packageName+@path+'.'+name
+    value = atom.config.get fullPath
+    if not value?
+      if obj?.default?
+        value = obj.default
+      else
+        value = atom.config.getDefault fullPath
+    value
+
+  getChildCleanName:(name,obj)->
+    cleanName = @cleanName name
     if obj.title?
       cleanName = obj.title
-    else
-      cleanName = @cleanName(name)
-    fullPath = @path+'.'+name
-    value = getConfigValue fullPath
+    cleanName
+
+  parseStringChild:(name,obj)->
+    cleanName = @getChildCleanName name,obj
+    value = @getConfigValue name,obj
+    console.log 'value',value
+    if not value?
+      value = ''
     str =
       "<div class='group'>
         <label for='#{name}'>#{cleanName}</label>

    @html = ''
    @cleanPackageName = @cleanName(@packageName)
    @title = @cleanName+" settings"
    @content = '
    <div id="editor-background-config">
      <div class="config-tabs">

        <div class="tab config-tab">Image</div>
        <div class="tab config-tab">Text</div>
        <div class="tab config-tab">Video</div>
        <div class="tab config-tab">3D Box</div>
        <div class="tab config-tab">About</div>

      </div>

      <div class="config-content">

        <div class="tab-content">
          <div class="group">
            <label for="imageURL">Image URL</label>
            <input type="text" id="imageURL" name="imageURL" style="width:500px;">
            <input type="file" id="imageURLFile" accept="image/*" style="display:none;">
            <button class="btn btn-default group-addon" id="imageURLFileBtn">...</button>
          </div>
          <div class="group">
            <label>Opacity</label>
            <input type="number" class="range" data-slider-range="0,100" id="opacity" name="opacity">
          </div>
        </div>

        <div class="tab-content">
          <div class="group">
            <label for="textBackground">Text background color</label>
            <input type="text" class="color-picker" name="textBackground" id="textBackground">
          </div>
          <div class="group">
            <label>Opacity</label>
            <input type="number" class="range" data-slider-range="0,100" id="textBackgroundOpacity" name="textBackgroundOpacity">
          </div>
        </div>

        <div class="tab-content">
          second
        </div>

        <div class="tab-content">
          third
        </div>

        <div class="tab-content">
          last
        </div>

      </div>

    </div>
    '
    @buttons = {
      "Apply":(ev,popup)=> @applyConfig(ev,popup),
      "Close":(ev,popup)=> @close(ev,popup)



  activateTab:(index)->
    @tabs = $(@configWnd).find('.tab')
    for i in [0..(@tabs.length-1)]
      do (i)=>
        if i==index
          @tabs[i].className='tab active'
        else
          @tabs[i].className = 'tab'

    @tabsContent = $(@configWnd).find('.tab-content')

    for j in [0..(@tabsContent.length-1)]
      do (j)=>
