Sha256: 28acb41c074dbdea9386e11bba6e703fcfb901c6d81a359a8f780404f826f5db

Contents?: true

Size: 785 Bytes

Versions: 8

Compression:

Stored size: 785 Bytes

Contents

import axios from 'axios'
const railsAdmin = {
  namespaced: true,
  state: {
    inputId: ''
  },
  mutations: {
    SET_INPUT_ID (state, id) {
      state.inputId = id
    }
  },
  actions: {
    setInputId ({ commit}, id) {
      commit('SET_INPUT_ID', id)
    },
    insertImage ({commit, state, dispatch}, idImage) {
      dispatch('overlayStore/showProgressOverlay', true, {root:true})
      // Generating new dynamic image size before sending it back
      axios.get(`/images/${idImage}?width=0&height=0`).then((response) => {
        dispatch('overlayStore/showProgressOverlay', false, {root:true})
        window.opener.insertImageManagerMedia(idImage, state.inputId, response.data.image.src_for_wysiwyg)
        window.close()
      })
    }
  }
}

export default railsAdmin

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rails_admin_image_manager-0.1.34 app/assets/javascripts/rails_admin_image_manager/stores/railsAdmin.js
rails_admin_image_manager-0.1.33 app/assets/javascripts/rails_admin_image_manager/stores/railsAdmin.js
rails_admin_image_manager-0.1.31 app/assets/javascripts/rails_admin_image_manager/stores/railsAdmin.js
rails_admin_image_manager-0.1.30 app/assets/javascripts/rails_admin_image_manager/stores/railsAdmin.js
rails_admin_image_manager-0.1.3 app/assets/javascripts/rails_admin_image_manager/stores/railsAdmin.js
rails_admin_image_manager-0.1.29 app/assets/javascripts/rails_admin_image_manager/stores/railsAdmin.js
rails_admin_image_manager-0.1.28 app/assets/javascripts/rails_admin_image_manager/stores/railsAdmin.js
rails_admin_image_manager-0.1.27 app/assets/javascripts/rails_admin_image_manager/stores/railsAdmin.js